SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: XML Menu issue

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XML Menu issue

    Hi,

    I have an XML menu, but for some reason the parnt of the last menu is using the previous link

    PHP Code:

    <site>

    <
    page url="http://www.mysite.com/test" title="Test1" onclick="_gaq.push(['_trackEvent', 'Test', 'Clicked', 'Test clicked']);"/>
        <
    page url="http://www.mysite.com/community" title="Community" class="communityTag">
            <
    page url="http://www.mysite.com/forum/" title="Forum" class="community"/>

        </
    page>

    </
    site
    The link for this

    PHP Code:

    <page url="http://www.mysite.com/community" title="Community" class="communityTag"
    is displaying :

    http://www.mysite.com/test

    What would cause this to happen?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,168
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    I don't understand how that code is meant to work, but I'll point out that there's no closing / at the end of the line in question.

  3. #3
    SitePoint Evangelist silver trophybronze trophy
    Join Date
    Jul 2013
    Posts
    406
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    As far as I know about XML (and that's not much! ), each tag has to get the same tag as closing tag, and it should be at least something like this:
    Code:
    <site>
         <page url="http://www.mysite.com/test" title="Test1" onclick="_gaq.push(['_trackEvent', 'Test', 'Clicked', 'Test clicked']);">
         </page>
         <page url="http://www.mysite.com/community" title="Community" class="communityTag">
         </page>
         <page url="http://www.mysite.com/forum/" title="Forum" class="community">
         </page>
    </site>
    And probably all the attributes have to be separated new tags (each with their own value) inside the <page></page> lines.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •