This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
57 Posts
12 days ago

Hello @all

[ French Use Case ]

Joomla 3.9.3
Seblod 3.x
PHP 7.1

Seblod / 1. Admin : In Form, I use the field "Related Article"
Seblod / 4. Content : I placed the field

Joomla / Article : There is a dropdown, I can choose the article

Joomla / Frontend : just the ID of the article appear


So, in my template, I try several ways to the the link.
1: <?php echo $cck->get('my_related_article')->value; ?>
2: <?php echo $cck->get(''my_related_article')->link; ?>
3: <?php echo $cck->getValue(''my_related_article'); ?>

With 1 and 3, I get the ID.
With 2, I get the alias of the current item menu.


Of course, in Seblod / 4. Content, option 2 (in square button), I choosed the option "view".
But no link was generated.

I have to do something more ?

Thank you for your help

Get a Book for SEBLOD
4142 Posts
10 days ago
Level 1

do <?php var_dump( $cck->getValue(''my_related_article')); ?>

this will output all available properties, so you can see which one has the needed value. You can later access this property by $cck->getValue(''my_related_article')->PROPERTYNAME (replace PROPERTYNAME with the name of the property)

57 Posts
9 days ago
Level 2

Thank you Klas.

I tried <?php var_dump( $cck->getValue(''my_related_article')); ?>
In frontend, it shows string(3) "683" 

So, just the ID of the article :(

How to get the others properties ?

4142 Posts
8 days ago
Level 3

Write just get, not getValue - getValue will get you only value property

57 Posts
8 days ago
Level 4

Great! Thank you.

<?php var_dump( $cck->get(''my_related_article')); ?>
It shows me everything!

So, I find the good property :)
<?php echo $cck->get('my_related_article')->text; ?>

And this generates the "intro" view of my article.

Perfect 👌

Get a Book for SEBLOD