Helix Template, Calling A Custom Field To An Override Of Blog_item.php - Question | JoomShaper
🎃 Halloween Sale is Live! Get 35% OFF on all plans. Sale ends soon! Get Offer

Helix Template, Calling A Custom Field To An Override Of Blog_item.php

F

FJN

Template 3 months ago

Hello,

Using Helix Ultimate template, we want to call a custom field (type text) value to a custom location above article titles on Blog Layout pages.

We are trying to create an override using the native Joomla blog_item.php file and editing it, but we cannot get the call to our field to render.

The override location we're trying is: /templates/shaper_helixultimate/html/com_content/category/blog_item.php

We're able to render straight HTML, but how can we call the value of a Custom Field to display as well?

0
4 Answers
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 3 months ago #197908

Hello FJN,

Thank you for your detailed follow-up and for sharing your solution with the community!

Your approach using the article alias as an HTML ID is a smart and practical way to uniquely target articles, especially in the blog layout view. It’s clean, SEO-friendly, and should work well as long as the aliases remain unique and properly formatted.

Also, your clarification on the override path is helpful for others who may be trying to do the same.

Really appreciate you taking the time to share your findings!

Best regards,

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 3 months ago #197890

Hello FJN,

Thank you for reaching out to us.

Please note that we do not offer customization services. You may consider hiring a developer to assist with your specific needs.

Thank you for your understanding.

Best regards,

0
F
FJN
Accepted Answer
3 months ago #197905

Actually, all I was hoping for was which file to override, and how to call a custom field value to that file. But I figured out a way to develop what I needed.

So, for the benefit of Joomshaper and its community... I wanted to call a custom value to articles in a blog-layout view so as to target them specifically by an HTML ID. Simply calling the article alias and adding it as an HTML ID attribute value worked...

Override: /templates/[JOOMSHAPER_TEMPLATE/html/com_content/blog_item.php (Helix template and native Joomla file for the override)

Just after <div class="item-content">

added: <a id="<?php echo htmlspecialchars($this->item->alias); ?>" aria-hidden="true"></a>

Which, minus my HTML comments regarding customization, renders: <div class="item-content"> <a id="[ARTICLE-ALIAS]" aria-hidden="true"></a>

Wrap that whole thing in a div with a class for styling: 
<div class="item-content">
    <div class="article-id">
            <a id="[ARTICLE-ALIAS]" aria-hidden="true"></a>
    </div>

Any issues with this approach, happy to know. :)

0
F
FJN
Accepted Answer
3 months ago #197910

Thank you, and you're welcome. Less is definitely more, is my philosopy. :)

ETA: And, yes, the IDs should be unique since article aliases must be unique.

0