Page 1 of 4 123 ... LastLast
Results 1 to 15 of 54

Thread: Not showing in the main categories

  1. #1
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default Not showing in the main categories

    Hi,

    How can I have the following sentence which appears on empty SUB-CATEGORIES and PARENT CATEGORIES to only apears on empty SUB-CATEGORIES and NOT on the main CATEGORIES!

    "There is not link on this category."

    Cheers
    Mitchell
    Last edited by Mitchell; 05-11-2008 at 08:58 PM.

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    You'd need to use an IF statement. I don't know what exactly but something like

    if parent == 0
    leave this blank
    else
    There is not link on this category.
    /if

  3. #3
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    Quote Originally Posted by Bruceper View Post
    You'd need to use an IF statement. I don't know what exactly but something like

    if parent == 0
    leave this blank
    else
    There is not link on this category.
    /if
    Thanks Bruce
    Should I use it in the browse? Any one knows the excat code please?

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Yes it would need to be used in browse.html

  5. #5
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    The existing code is;

    <%if $link%>
    <%block_sort_links use_pagerank="yes" use_custom_field="yes" exclude_custom_field=""%>
    <%$link%>
    <%else%>
    <%t%>There is no link here.<%/t%>
    <%/if%>
    I tried adding some thing like this but didn't work,

    <%if parent == 0%>
    leave this blank
    <%else%>
    Already there is another <%else%> there, can I add another one too?

  6. #6
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    I think you need to use

    <%elseif%>

    when there is already another <%else%> in the same statement. Let Bruce or one of the other wiser PHP guys confirm this though


    EDIT - I change my "elseif" above to match what Bruce said below. My original one had a space in it.
    Last edited by FSGDAG; 05-08-2008 at 10:42 PM. Reason: See Edit in post
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  7. #7
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Two else's don't make a right

    Yes if you want more than one else the second one needs to be an elseif

  8. #8
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Quote Originally Posted by Bruceper View Post
    Two else's don't make a right
    Ohh man... My knee hurts from all the slapping!!!
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  9. #9
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default


  10. #10
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    This is the bast I can think and still have no idea what to do with "leave this blank", whee that goes?

    <%if $link%>
    <%block_sort_links use_pagerank="yes" use_custom_field="yes" exclude_custom_field="long_description"%>
    <%$link%>
    <%else%>
    <%if $parent == 0%>
    leave this blank
    <%elseif%>
    <%t%>There is no link here.<%/t%>
    <%/if%>
    Last edited by Mitchell; 05-09-2008 at 12:07 AM.

  11. #11
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Leave this blank means exactly that, dont' have anything there.

    The script will probably ***** about that so just put an &nbsp; there and it's all good.

  12. #12
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    Okay,

    This one didn't work, the subcategory pages didn't load after I changed it.

    <%if $link%>
    <%block_sort_links use_pagerank="yes" use_custom_field="yes" exclude_custom_field=""%>
    <%$link%>
    <%else%>
    <%t%>There is no link here. <%/t%>
    <%elseif%>
    <%if $parent == 0%>
    &nbsp;
    <%/if%>
    Last edited by Mitchell; 05-09-2008 at 01:00 AM.

  13. #13
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Try this...

    PHP Code:
    <%if $link%>
    <%
    block_sort_links use_pagerank="yes" use_custom_field="yes" exclude_custom_field=""%>
    <%
    $link%>
    <%else%>
    <%if 
    $parent == 0%>
    <%
    t%>&nbsp;<%/t%> 
    <%elseif%>
    <%
    t%>There is no link here. <%/t%> 
    <%/if%> 
    I added a text output for the "&nbsp;". I also changed the order of the <else> statement. I think you want to check for the parent ID first.

    Again, I'm not a programmer, but maybe it doesn't like the space command without a text output statement and the order of it.

    If this works, I require your next child to be named after me!!!!
    Last edited by FSGDAG; 05-09-2008 at 08:41 AM. Reason: Changed order of <else> statement
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  14. #14
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    Thanks for your help, unfortunately didn't work, I get the following message;

    Fatal error: Smarty error: [in /home/wedonly/public_html/themes/bridal/browse.html line 47]: syntax error: 'elseif' statement requires arguments (Smarty_Compiler.class.php, line 1256) in /home/wedonly/public_html/lib/smarty/Smarty.class.php on line 1088

  15. #15
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    Quote Originally Posted by Mitchell View Post
    Okay,

    This one didn't work, the subcategory pages didn't load after I changed it.
    Code:
    <%if $link%>
    <%block_sort_links use_pagerank="yes" use_custom_field="yes" exclude_custom_field=""%>
    <%$link%>
    <%else%>
    <%t%>There is no link here. <%/t%> 
    <%elseif%>
    <%if $parent == 0%>
    &nbsp;
    <%/if%>
    the pseudo code for the IF statement is:

    Code:
    BEGIN IF
    ELSEIF
    ELSE
    END IF
    The ELSEIF must appear before the ELSE



    .
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

Similar Threads

  1. -- not showing new signs; or added categories
    By webandlinkscom in forum v5.x
    Replies: 1
    Last Post: 04-26-2007, 11:44 PM
  2. big space before main categories
    By SKh in forum v5.x
    Replies: 4
    Last Post: 09-24-2006, 07:22 AM
  3. Replies: 8
    Last Post: 08-18-2006, 04:43 AM
  4. Replies: 0
    Last Post: 03-07-2006, 12:50 PM
  5. Only Main Category showing
    By Polo5 in forum v5.x
    Replies: 1
    Last Post: 02-09-2004, 11:05 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
  •