Jump to content

Li last item site docs


Guest gl82

Recommended Posts

Hi

When the site docs are displayed along the top of a page I need the last menu item to have a class like ="last_item" added to it. That way I can remove the right | border that appears on the last menu item.

I had a look through the forum posts and found a post that may look like it addresses the question however I do not have permission to view that post.

I presume I have to add some php if statement asking if this is the last item and if it is add something etc

Thanks in advance

:)

Link to comment
Share on other sites

Hi

It should remove itself, unless the code has been modified on either includes/boxes/siteDocs.inc.php or skins/YOUR_SKIN/styleTemplates/boxes/siteDocs.tpl

On the inc file you should have this.....

## Build attributes

if ($results) {

    $maxi = count($results);

    foreach ($results as $i => $result) {

        if ($i<$maxi-1) {

            $box_content->parse('site_docs.a.sep');

        }


And on the tpl file, this...


    <!-- BEGIN: a -->

    <a class="txtSiteDocs" href="{DATA.doc_url}" {data.doc_url_target}="">{DATA.doc_name}</a>

    <!-- BEGIN: sep --><span class="txtSiteDocs">|</span><!-- END: sep -->

    <!-- END: a -->

This adds a seperator to each document except the last one.

Lee

Link to comment
Share on other sites

hmm ok i have the same in the include file, but not in the tpl. How does it know not to add it to the last one, thank you for the feedback? I can program in php and java etc so just curious as it doesn't appear to have any condition or loop in the tpl file

This is what the siteDocs.tpl file currently has

<!-- BEGIN: site_docs -->

<div id="menu">

<ul>

<li class="current_page_itemS"><a href="index.php">Home</a></li>

<!-- BEGIN: a -->

<li><a href="{DATA.doc_url}" class="txtSiteDocs" {DATA.doc_url_target}>{DATA.doc_name}</a></li>

<!-- END: a -->

</ul>

</div>

<!-- END: site_docs -->

This is what I will change it to

<!-- BEGIN: site_docs -->

<div id="menu">

<ul>

<li class="current_page_itemS"><a href="index.php">Home</a></li>

<!-- BEGIN: a -->

<li><a href="{DATA.doc_url}" class="txtSiteDocs" {DATA.doc_url_target}>{DATA.doc_name}</a></li>

<!-- BEGIN: sep --><span class="txtSiteDocs">|</span><!-- END: sep -->

<!-- END: a -->

</ul>

</div>

<!-- END: site_docs -->

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...