From: Jean-Marc L. <jea...@gm...> - 2010-09-11 16:50:12
|
On Sat, Sep 11, 2010 at 12:49 PM, Stephane Casset <se...@lo...> wrote: > Le Fri, Sep 10, 2010 at 03:53:55PM -0300, Rodrigo Sampaio Primo écrivait : >> >> Hi Stephane, >> I was discussing with Jonny in the IRC this issue and we decided that while {self_link} does not support sefurl the way to go in this case (and another one I just commited, revision 29113) is using <a>. >> Please let us know if we are missing something and there is a way to tell {self_link} to generated the link with sefurl. >> Thanks, Rodrigo. > > <a href="{$post_info.adjacent.prev.postId|sefurl:blogpost}" title='{tr}Previous post{/tr}'>← {$post_info.adjacent.prev.title|truncate}</a> > > Could normally de replaced by : > > {self_link _script="$post_info.adjacent.prev.postId|sefurl:blogpost" _title='{tr}Previous post{/tr}'}← {$post_info.adjacent.prev.title|truncate:45}{/self_link} > > No ? > > What will be the best way ? > o automatically construct sefurl in {button} {self_link} {query} ? > * pb with this approach is that we have to reverse the process of > sefurl as we have the full URI, doable but more code I think this would be brittle; since {button} {self_link} {query} might incorrectly guess what sefurl type should be used. > o add parameter to {button}, {self_link} and {query} to take sefurl > into account ? > * easier than the above, but less generic... Something like: {self_link _script="$post_info.adjacent.prev.postId" _sefurl="blogpost" _title='{tr}Previous post{/tr}'} would be easier to read, and give better control to tpl coders. Cheers, J-M |