Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

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

  • Options
    KasperKasper Scholar of the Bits Copenhagen 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

  • Options

    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 :)

  • Options
    KasperKasper Scholar of the Bits Copenhagen 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

  • Options

    sweeeeeeet. thanks :)

  • Options

    @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 ?

  • Options
    KasperKasper Scholar of the Bits Copenhagen 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

  • Options

    .Section-PostDiscussion
    InSection("PostDiscussion");

    this one ddnt work on me on v21.

  • Options
    KasperKasper Scholar of the Bits Copenhagen 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

  • Options
    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.

  • Options
    KasperKasper Scholar of the Bits Copenhagen 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.