Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alexey Shevchenko 15 posts 34 karma points
    Aug 31, 2011 @ 14:12
    Alexey Shevchenko
    0

    Footer

    Hi all

    Stucture of my project

     

    - Company profile
      - cp_sub1
      - cp_sub2
      - cp_sub3
    - Eco taxe
      - et_sub1
      - et_sub2

    And I want to add footer with some items to my site, and this footer shouldn't be static. As I understand I should add new branch to tree:

     

    - Company profile
      - cp_sub1
      - cp_sub2
      - cp_sub3
    - Eco taxe
      - et_sub1
      - et_sub2
    - Road network
      - rn_sub1
      - rn_sub2
    - Footer
      - f1
      - f2

    But here two unclear things for me.
    Firstly: If I add Footer to tree, it will be visible in top menu. I don't need it.
    Secondly: How should I show items of Footer in rigth place?

     

     

  • ianhoughton 233 posts 433 karma points c-trib
    Aug 31, 2011 @ 17:51
    ianhoughton
    0

    Here are 2 ways I've achieved this in the past:

    1) Create a tick box on your page datatype such as "Show in Footer". You can then setup your XSLT code to filter for nodes that have this ticked. You then don't need to create a footer section in the tree.

    2) If you want to create a seperate Footer section in the tree, then you need to add a field to those Nodes such as "Hide in Navi". Then modify your menu XSLT to remove anything with this field ticked.

  • Alexey Shevchenko 15 posts 34 karma points
    Aug 31, 2011 @ 18:22
    Alexey Shevchenko
    0

    Thank You.

  • Rasmus Berntsen 213 posts 251 karma points c-trib
    Sep 01, 2011 @ 10:04
    Rasmus Berntsen
    0

    Hey Alexey!

    Ianhoughton's way is surely one way to go, but I don't really think it's a nice solution to create content-pages if it's not content (like in pages to visit), like with your footer? I assume that the footer data will be textstrings, and that you'll output these in a div or ul? If yes, then I would recommend you to take a look at the Embedded Content package: http://our.umbraco.org/projects/backoffice-extensions/embedded-content 

    Then I would add this datatype to my top-node (usually "Home") and write a recursive XSLT/Razor-script, that always looks for this nodetypealias and outputs the textstrings.

    The embedded content should be a part of Umbraco. I use it all the time. :)

    /Berntsen

     

  • Alexey Shevchenko 15 posts 34 karma points
    Sep 01, 2011 @ 21:11
    Alexey Shevchenko
    0

     

    Thanks Berntsen.

    I did it in such way:

    1. I Add footer to tree as new branch. I know id of footer page (1070), so for to hide footer in top menu I add check to xslt: 

    <xsl:if test="@id != 1070">

    2. Because I know id of footer page I can get all footer's child. I made macro:

    <tr>
      <xsl:for-each select="$footer/child::* [@isDoc and umbracoNaviHide != 1]">
        <td class="item">   
            <href="{umbraco.library:NiceUrl(@id)}">
                <div>
                    <xsl:value-of select="@nodeName" />
                </div>
            </a>
        </td>
        <td class="separater">
            <div>&nbsp;</div>
        </td>
      </xsl:for-each>
    </tr>

  • Rasmus Berntsen 213 posts 251 karma points c-trib
    Sep 01, 2011 @ 23:16
    Rasmus Berntsen
    0

    Hi Alexey!

    It works - great! If you want to make it perfect, I would recommend to write a variable to get the ID for the footer-page by checking it's documenttype and not hardcoding the ID. This would make it more flexible and usable on other solutions. But that's a minor thing. Most importantly - it works! Yay! :)

Please Sign in or register to post replies

Write your reply to:

Draft