Results 1 to 12 of 12

Thread: List of Variables?

  1. #1
    Join Date
    Jul 2006
    Posts
    52

    Default List of Variables?

    Is there a full list of the variables anywhere?

    I'm trying to use if / else statements to display certain content on some pages but not all ie. not on main page, but on categories and other pages

    The wiki page hasn't been created

  2. #2
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    I dont understand.

    You can use
    Code:
    <% if $something!='' %> this is <%$something%>
    
    <%else%>
    somethign didnt exist, so i will do nothing
    
    <%/if%>
    you would put that code into detail_link.html, if you didnt want it displayed on another page you wouldnt add the code.

    Im assuming your doing it with blocks - tell us what your trying to achieve.
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  3. #3
    Join Date
    Jul 2006
    Posts
    52

    Default

    I'm trying to change part of the header depending on what type of page the person is on.

    If you go to http://www.armchair.ie you will see that there are no google ads on the main page, however there are ads on the category pages.

    What I can't work out is which variables to use for the other non-category pages, excluding the main page.

    Do you get me?

  4. #4
    Join Date
    May 2006
    Posts
    26

    Default

    Quote Originally Posted by blacknight
    Is there a full list of the variables anywhere?

    I'm trying to use if / else statements to display certain content on some pages but not all ie. not on main page, but on categories and other pages

    The wiki page hasn't been created
    This question has been beat to death already for months. The answer that you will get is to look at the incomplete documentation site at http://www.indexuguide.com . I know as I have been looking for this list myself.

    The best answer that I have self tough myself is to look into the templates directory and take your best guess at what each one you find does. Each template variable starts with a <% and ends iwth %> . You can also include files and php using <%include_php file ="filename.php"%> or <%include file ="filename.ext"%> where ".ext" stands for the extention like .html or .txt . There are also some simple script tests you can do using "if" statements etc.
    Last edited by GremlinGod; 08-12-2006 at 12:52 PM.

  5. #5
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    its smarty... all the variables are the same as on the smarty website, except the are using the <% %> instead of the standard ones that use {}
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  6. #6
    Join Date
    May 2006
    Posts
    26

    Default

    Quote Originally Posted by inspireme
    its smarty... all the variables are the same as on the smarty website, except the are using the <% %> instead of the standard ones that use {}
    A URL would be helpful. :-) Thank you

  7. #7
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    heres the documentation for smarty :

    http://smarty.php.net/manual/en/

    the chapters 7 and 8 are the most relevant
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  8. #8
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    If you go to http://www.armchair.ie you will see that there are no google ads on the main page, however there are ads on the category pages.

    What I can't work out is which variables to use for the other non-category pages, excluding the main page.
    Okay, you can detect the category page by identifiying the value of these variables: <%$cat%> or <%$category_path_search_opt%>. But i suggest the latest one. Here is a sample code for your header
    Code:
    <%if $category_path_search_opt%>
    ................ google code here ................
    <%else%>
    ................ non category page code here ................
    <%/if%>

  9. #9
    Join Date
    Jul 2006
    Posts
    52

    Default

    Dody - what about the non-category pages? Do they have a specific variable each?
    I'm trying to place specific content on certain pages - not just ads, so knowing which variable to use is important.

    For example, I've moved the "subscribe to category" into the header, but I've got it to only display on category pages, as it would be pointless displaying it on other pages

  10. #10
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    Quote Originally Posted by blacknight
    Dody - what about the non-category pages? Do they have a specific variable each?
    I'm trying to place specific content on certain pages - not just ads, so knowing which variable to use is important.

    For example, I've moved the "subscribe to category" into the header, but I've got it to only display on category pages, as it would be pointless displaying it on other pages
    i did that, put htis in your header :
    Code:
     <%if $category_path_with_link !=''%> <%$category_path_with_link%>
    	<%else%>  
    	 <%$category_path%> 
    <%/if%>
    as i remember i got a bit confused when i did that, but the above seems to be workign great on my site, and i cant remember what the problem was
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  11. #11
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Dody - what about the non-category pages? Do they have a specific variable each?
    I'm trying to place specific content on certain pages - not just ads, so knowing which variable to use is important.
    Currently there's no identified regarding which page is being processed.

  12. #12
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    although you cant check to see what page you are on, you CAN check to see if a variable exists and deside what to do... eg/ my example above... sure not the prettiest solution but it worked for me.
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

Similar Threads

  1. my website own variables
    By SKh in forum v5.x
    Replies: 1
    Last Post: 05-26-2006, 03:37 AM
  2. block and variables
    By inspireme in forum v5.x
    Replies: 1
    Last Post: 04-17-2006, 03:51 PM
  3. variables on add_pending
    By inspireme in forum v5.x
    Replies: 4
    Last Post: 01-17-2005, 03:51 PM
  4. variables. Im confused
    By inspireme in forum v5.x
    Replies: 4
    Last Post: 11-15-2004, 11:35 AM
  5. variables in php script
    By acio in forum v5.x
    Replies: 8
    Last Post: 06-22-2003, 07:24 AM

Posting Permissions

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