- Posts: 36
COMMUNITY FORUM
[SOLVED] Specific Extra Fields in tag.php
- Andrew Paterson
-
Topic Author
- Offline
- Junior Member
Less
More
10 years 6 months ago #133155
by Andrew Paterson
Specific Extra Fields in tag.php was created by Andrew Paterson
Hi All
I'd like to place specific extra fields in my template override for tag.php. I've tried this:
I'd like to place specific extra fields in my template override for tag.php. I've tried this:
Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 6 months ago #133156
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Specific Extra Fields in tag.php
Hello Andrew,
You should use $item instead of $this->item for the tag layout.
You should use $item instead of $this->item for the tag layout.
Please Log in or Create an account to join the conversation.
- Andrew Paterson
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 36
10 years 6 months ago #133157
by Andrew Paterson
Replied by Andrew Paterson on topic Re: Specific Extra Fields in tag.php
Working perfectly- thank you!
Please Log in or Create an account to join the conversation.
- MessageDJ
-
- Offline
- New Member
Less
More
- Posts: 15
10 years 4 months ago #135738
by MessageDJ
Replied by MessageDJ on topic Specific Extra Fields in tag.php
i have no clue why, but nothing shows when i add this.
my site contains all sorts of Trips, and the Extrafield i like to show in the TagView is Duration. The extrafield Alias is called " Duration" i added this code after the title.
should i add some more code in the head or something?
<?php if($this->item->extraFields->Duration->value != ''): ?>
<?php echo $this->item->extraFields->Duration->name ?>
<?php echo $this->item->extraFields->Duration->value ?>
my site contains all sorts of Trips, and the Extrafield i like to show in the TagView is Duration. The extrafield Alias is called " Duration" i added this code after the title.
should i add some more code in the head or something?
Please Log in or Create an account to join the conversation.
- MessageDJ
-
- Offline
- New Member
Less
More
- Posts: 15
10 years 4 months ago #135739
by MessageDJ
Replied by MessageDJ on topic Specific Extra Fields in tag.php
already found it.....
<?php $extrafields = json_decode($item->extra_fields);?>
<?php foreach($extrafields as $key=>$value): ?>
<?php if($extrafields[$key]->id == 'EXTRA_FIELD_ID_NR'&&$extrafields[$key]->value!=''): ?>
<?php echo $extrafields[$key]->value; ?>,
<?php endif; ?>
<?php endforeach; ?>
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 4 months ago #135760
by Krikor Boghossian
Replied by Krikor Boghossian on topic Specific Extra Fields in tag.php
Thank you for sharing the solution :)
Please Log in or Create an account to join the conversation.