-
AuthorPosts
-
September 26, 2012 at 2:30 pm #468250
Oh No…somethings not quite right… just got this error
Parse error: syntax error, unexpected $end in /home/content/02/8796802/html/templates/ja_wall/html/com_k2/ja_wall/category_item.php on line 280
September 26, 2012 at 2:32 pm #468251Could it be the 2 & near the “Frasier Props” bit
September 26, 2012 at 2:34 pm #468252Oh also to answer your question before… I will only be doing this sparringly every now and then, so I guess Im excluding not including…
arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
September 26, 2012 at 2:43 pm #468254Sorry was missing a 3rd <?php endif; ?> try the code below, it should work now. Tested it on my site.
[PHP]<?php if ($this->item->params->get(‘catItemReadMore’)): ?>
<?php if ($this->item->category->name == ‘Frasier Props’ && $this->item->category->name == ‘Friends Props’): ?>
<p class=”readmore”>
<a class=”item-link” href=”<?php echo $this->item->category->link; ?>”><?php echo JText::_(‘K2_WALL_READ_MORE’); ?></a>
</p>
<?php else: ?>
<p class=”readmore”>
<a class=”item-link” href=”<?php echo $this->item->link; ?>”><?php echo JText::_(‘K2_WALL_READ_MORE’); ?></a>
</p>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>[/PHP]1 user says Thank You to arucardx for this useful post
September 26, 2012 at 2:45 pm #468256Bummer sorry arucardx
I just got this error
Parse error: syntax error, unexpected T_ENDIF in /home/content/02/8796802/html/templates/ja_wall/html/com_k2/ja_wall/category_item.php on line 269September 26, 2012 at 2:48 pm #468257Oh its ok!! Its working now..I just noticed I had a
<?php endif; ?>
above my code…. just a remnant from the old code think!!! The site is showing good now!! Just gotta test it!September 26, 2012 at 2:55 pm #468258Hmm I just made a category called Friends Props and set the category template to Ja_wall. Then I made a K2 Item called Friends Props (and set it to Friends Props Category)… but it directs me to the usual item page, not a wall… Have I missed something obvious!?
arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
September 26, 2012 at 3:11 pm #468261Are you able to provide a link to your site so I can see the source code output on the page? Btw since we only modified the link on read more, you need to actually click on read more to see the effect.
Alternatively you can replace && with || and see if it works.
1 user says Thank You to arucardx for this useful post
September 26, 2012 at 3:15 pm #468263Hi, sure thing!
My site is http://www.sillynym.com (changing that later ;)) and Im putting these items on the front page buy adding a tag “homepage”sorry those 2 dashes..are they L’s ? Hmm I dont recognize them, they seem very long.
September 26, 2012 at 3:18 pm #468264Bummer, I just copied those dashes and replaced those && , then refreshed my page and clicked “read more” but still no luck 🙁
arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
September 26, 2012 at 3:26 pm #468265The two || is from the key above enter which create
I forgot what the | is called lol, but it’s not a L. Can you try that and see if it works? The if check seems to have failed so the conditions checking is most likely wrong. I’m always confused with the usage of && or || sometimes they works here, sometimes they don’t work there. But if it doesn’t then we need to test if the code is even working by testing without condition checking.
Meaning we just use this code as it is. We do not check for category name. That way we can test if the link that’s being echo is correct.
[PHP]<?php if ($this->item->params->get(‘catItemReadMore’)): ?>
<p class=”readmore”>
<a class=”item-link” href=”<?php echo $this->item->category->link; ?>”><?php echo JText::_(‘K2_WALL_READ_MORE’); ?></a>
</p>
<?php else: ?>[/PHP]1 user says Thank You to arucardx for this useful post
September 26, 2012 at 3:31 pm #468266Heheh I didnt even know the key existed, so your always gonna win against me! Found it though, and tested itm but no luck 🙁
Sure I can try that code.. do I just replace the old code you gave me, with this one?
Ill try it now anyway 🙂
September 26, 2012 at 3:33 pm #468267Ok.. its in, and everything is acting normally
September 26, 2012 at 3:35 pm #468269Oh no I spoke too soon, my front page is fine.. but just got this error when I checked my category links
Parse error: syntax error, unexpected $end in /home/content/02/8796802/html/templates/ja_wall/html/com_k2/ja_wall/category_item.php on line 274
arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
September 26, 2012 at 3:41 pm #468271Lol ok, i think I see where the problem is. You are using tags to display the article on frontpage thus it’s actually loading tag.php instead of category_item.php
Please replace with your category_item.php with the original copy for now or just revert back to the code that was not giving you an error just now. Then go to com_k2defaulttag.php note that it’s the default folder, not JA Wall.
Remember to make a backup of the file. Then look for this block of code around line 171.
[PHP]
<?php if ($item->params->get(‘tagItemReadMore’)): ?>
<p class=”readmore”>
<a class=”item-link” href=”<?php echo $item->link; ?>”>
<?php echo JText::_(‘K2_READ_MORE’); ?>
</a>
</p>
<?php endif; ?>[/PHP]Replace it with this block of code.
[PHP] <?php if ($item->params->get(‘tagItemReadMore’)): ?>
<?php if ($item->category->name == ‘Frasier Props’ && $item->category->name == ‘Friends Props’): ?>
<p class=”readmore”>
<a href=”<?php echo $item->category->link; ?>”><?php echo JText::_(‘K2_READ_MORE’); ?></a>
</p>
<?php else: ?>
<p class=”readmore”>
<a class=”item-link” href=”<?php echo $item->link; ?>”><?php echo JText::_(‘K2_READ_MORE’); ?></a>
</p>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>[/PHP]That should solve your problem =) Was loading the wrong file on homepage.
1 user says Thank You to arucardx for this useful post
-
AuthorPosts
This topic contains 61 replies, has 2 voices, and was last updated by arucardx 12 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum