Vanilla open source was terminated 1 January 2025 by Higher Logic. See this announcement for more information.

knowing the current location

hi guys,

I'm pretty new to smarty, is there a function just like IsMobile() that knows where the page is like , IsDiscussions().

regards.

Comments

  • KasperKasper Vanilla Staff

    In 2.1, you can use InSection():

    InSection("Dashboard");
    
    // ...or as an array
    
    InSection(array("Discussion", "DiscussionList"));
    

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • hi @kasperisager where can i find a documentation for "Discussion", "DiscussionList" etc. etc ? or where can i find it in smarty? this info is very helpfull.. thanks :)

  • KasperKasper Vanilla Staff

    If you check out the source of this very page, you'll find that the body element has the class Section-Discussion - to target this section using the InSection() function, you'd therefore write:

    InSection("Discussion");
    

    It's as simple as that :-)

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • sweeeeeeet. thanks :)

  • @kasperisager just a followup question about this. i only have 3 of them, Section-Discussion, Section-DiscussionList, Section-Profile, i'd like to get the inbox-message section, but can't, where should i find it ?

  • KasperKasper Vanilla Staff

    I'm not sure how many "sections" are added in the alpha, but the latest beta version contains "sections" for every single view in Vanilla:

    .Section-DiscussionList
    .Section-Discussion
    .Section-PostDiscussion
    
    .Section-ConversationList
    .Section-Conversation
    .Section-PostConversation
    

    ...and the list goes on.

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • .Section-PostDiscussion
    InSection("PostDiscussion");

    this one ddnt work on me on v21.

  • KasperKasper Vanilla Staff

    Which version are you using?

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • fr3em1ndfr3em1nd ✭✭
    edited February 2013

    vanilla Version 2.1a33
    i need this since i want to make a sidebar if a poster of new discussion is posting their discussion for some rules and regulations.

  • KasperKasper Vanilla Staff

    You'll need the latest beta to use all the "Sections" I'm afraid

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

Sign In or Register to comment.