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
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.
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
Yes it would need to be used in browse.html
The existing code is;
I tried adding some thing like this but didn't work,<%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%>
Already there is another <%else%> there, can I add another one too?<%if parent == 0%>
leave this blank
<%else%>
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
Two else's don't make a right
Yes if you want more than one else the second one needs to be an elseif
FSGDAG | IndexU Hosting | Owner
Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
Follow Us On Twitter | FaceBook Profile | YouTube Videos
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.
Leave this blank means exactly that, dont' have anything there.
The script will probably ***** about that so just put an there and it's all good.
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%>
<%/if%>
Last edited by Mitchell; 05-09-2008 at 01:00 AM.
Try this...
I added a text output for the " ". I also changed the order of the <else> statement. I think you want to check for the parent ID first.PHP Code:<%if $link%>
<%block_sort_links use_pagerank="yes" use_custom_field="yes" exclude_custom_field=""%>
<%$link%>
<%else%>
<%if $parent == 0%>
<%t%> <%/t%>
<%elseif%>
<%t%>There is no link here. <%/t%>
<%/if%>
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
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
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Australian Websites & Directories
http://www.weddingsonly.com.au
http://www.directoryonly.com.au
http://www.weddinghost.com.au
http://www.iconfilmproductions.com
http://www.iconimagecentre.com.au
http://www.australiancollection.com.au