- Posts: 58
COMMUNITY FORUM
Having Difficulty Modifying category_item.php
- Timothy Michel
-
Topic Author
- Offline
- Senior Member
Less
More
10 years 8 months ago - 10 years 8 months ago #130771
by Timothy Michel
Having Difficulty Modifying category_item.php was created by Timothy Michel
I want to use K2 Categories for the ACYMailing "Latest Newsletter" and "Newsletter Archive" but I want the links to the ACYMailing generated :Latest Newsletter" and "Newslatter Archive" pages rather than the K2 generated Category Item pages.
Here is the code I am trying, but the code always falls through to the else statement and never adds the fixed link to the "Latest Newsletter" title.
Here is the code I am trying, but the code always falls through to the else statement and never adds the fixed link to the "Latest Newsletter" title.
<?php if ($this->item->params->get('catItemTitleLinked')): ?>
<?php if ($this->item->title=='Latest Newsletters'): ?>
<a href="http://webdev.911truthoutreach.org/911-news/latest-newsletters.html">
<?php else: ?>
<a href="<?php echo $this->item->link; ?>">
<?php endif; ?>
<?php echo $this->item->title; ?>
<?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?>
<?php if(isset($this->item->extraFields->titleRowTwo->value)): ?>
<br /><?php echo $this->item->extraFields->titleRowTwo->value; ?>
<?php endif; ?>
<?php endif; ?>
</a>
<?php else: ?>
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 8 months ago #130772
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Having Difficulty Modifying category_item.php
It would be more optimal to check the id of the item and not the title.
<?php if ($this->item->id == ID): ?>
Please Log in or Create an account to join the conversation.
- Timothy Michel
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 58
10 years 8 months ago #130773
by Timothy Michel
Replied by Timothy Michel on topic Re: Having Difficulty Modifying category_item.php
Thanks again Krikor. that makes good sense, much harder to get a number wrong than a long string of characters.
I found a great tutorial online that goes into how K2 is laid out what each file does and how each file can be manipulated. Pretty tired right now so I will post the link to the tutorial another time.
I found a great tutorial online that goes into how K2 is laid out what each file does and how each file can be manipulated. Pretty tired right now so I will post the link to the tutorial another time.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 8 months ago #130774
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Having Difficulty Modifying category_item.php
Once you 're at it, why don't you read nuevvo.com/blog/item/84-k2-inheritance-sub-templating as well?
It is really helpful.
It is really helpful.
Please Log in or Create an account to join the conversation.