![]() |
URL Trouble
I have been messing with this problem on and off for a good day now, here's the deal.
The following code is used in my categories.tpl file to display each category Code:
{section name=cat_num loop=$categories} The problem is that when the category title extends to a second line (because it exceeds 23 characters) the link does not carry the categoryid number in the URL. Here are two examples or typical links... Working URL Example (top line): http://www.thewebsite.com/store/customer/home.php?cat=328&XCARTSESSID=6dea0fbfecc8864014e6f b291cf8df0a Non-Working URL Example (bottom line): http://www.thewebsite.com/store/customer/home.php?cat=.categoryid&XCARTSESSID=6dea0fbfecc88 64014e6fb291cf8df0a Thanks in advance to anyone who can solve this. I am drawing a blank. :( |
Cant you just change this to:
Code:
{section name=cat_num loop=$categories} |
FD Suggestion
Hi FD,
Yeah I had that, but the problem is that the underline that designates the link is then underlining the \n. I don't want to add the "text decoration: none" to the CSS so I am left with trying to figure out how to 'restart' the link. According to smarty.php.net it says I should simply leave off the smarty designators {}, but as you can see, no luck. It's weird the '$categories[cat_num].categoryid' is being interpretted, but I can't figure out how. See how in non-working link the '$categories[cat_num]' doesn't show up, but the .categoryid does? Maybe I need some quotes or something? Thanks for the suggestion. Any others? You think Boomer might know? :?: |
How about putting in {assign var="temp" value=$categories[cat_num].categoryid} before this and using $ as the href
<a href="home.php?cat={$temp}"> |
No can do, because it puts two smarty tags - {$temp} - inside of two other smarty tags. I tried leaving them off, but then the value simply doesn't show up. I also tried the {ldelim} and {rdelim} tags, but that too did not work.
Fun heh? :D There has to be a way, and I am betting it is simple. I just don't see it, yet. Thanks again. I definitely welcome more input. |
Sorry I didn't make myself clear, try this:
Code:
{section name=cat_num loop=$categories} |
Doh...
Here's what I get when I add in the code... Parse error: parse error in /home/thewebsite/public_html/store/templates_c/%%-12/%%-1253885908/categories.tpl.php on line 50 |
I've just used that code and it worked fine for me. Are there any other problems in the templates that you changed.
|
Hmm... I defaulted back to the original categories.tpl and it worked. I'll mess with it a bit and let you know the success story.
Excellent code, I must admit I did think about assigning a temporary variable like you did, but was too stubborn to implment it. Great work FD! If you ever run for office, let me know. :D |
Got it now, works perfectly. Thanks again.
|
All times are GMT -8. The time now is 09:41 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.