example:
Imprint | Services | Contact us |
<li[+wf.id+][+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>[+wf.wrapper+] |</li>
how must i go to have WF omit the last pipe?
help much appreciated, many thanks!
moddex is cool
Quote from: nameuser at Jul 31, 2011, 09:28 AM
example:
Imprint | Services | Contact us |
<li[+wf.id+][+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>[+wf.wrapper+] |</li>
how must i go to have WF omit the last pipe?
help much appreciated, many thanks!
I’m not sure it this will work. You can try this:
create a new snippet ’pipe’:
<?php
$id = isset($id) ? $id : '';
$output = $modx->getPlaceholder('pipe'.$id);
$modx->setPlaceholder('pipe'.$id,'|');
return $output;
and use it like that:
<li[+wf.id+][+wf.classes+]>[[pipe? &p=`[+wf.id+]`]]<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>[+wf.wrapper+]</li>
this should place a pipe at the beginning of each li, but not on the first one. Does it?
-
☆ A M B ☆
- 24,524 Posts
I prefer to use a background image for the li or the a element set to top right no-repeat display in the CSS, and of course the .last (or .first, as appropriate) doesn’t have the background image. The image only needs to be one or two pixels wide. You can do much nicer borders with such a method. For example, a black background and a 2-pixel wide image can look like this
many, many thanks to all!
(haven’t tried yet but i’m sure one and/or the other...)
moddex is cool
doh! me...
i overlooked wayfinder’s class="last" function *blush*
but the tips were still quite enlightening!
moddex is cool