Keyword

Link field

  • yannick berges
  • yannick berges's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 8 months ago #160868 by yannick berges
Link field was created by yannick berges
hello i create a link field alias bateau2
and i add this code
<?php if(!empty($this->item->extraFields->bateau2->value)): ?>
            <p class="TabGras">AUTRES <span> CHOIX SIMILAIRES :</span></p>  
            <?php echo $this->item->extraFields->bateau2->value; ?>
            <?php endif; ?>
but nothing was display ...
if i remove if condition text is good but value isn't display ...
when i print value
[28] => stdClass Object
        (
            [id] => 33
            [name] => Bateau 2
            [value] => nom bateau 2
            [type] => link
            [group] => 1
            [published] => 1
            [ordering] => 29
            [url] => index.php
            [text] => nom bateau 2
            [attributes] => 
            [alias] => bateau
        )
why <?php echo $this->item->extraFields->bateau2->value; ?> display anything ....

Please Log in or Create an account to join the conversation.

  • yannick berges
  • yannick berges's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 8 months ago #160898 by yannick berges
Replied by yannick berges on topic Link field
nobody ?

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
7 years 8 months ago #160906 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Link field
Hello,

Is it an itemlist/category or item view?

The value should be an html representation of the link, and the structure you printed is for an object!
I think it is the same problem as your other post, seems the extra fields are disabled in the current view.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

  • yannick berges
  • yannick berges's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 8 months ago #160910 by yannick berges
Replied by yannick berges on topic Link field
its on item view, all other fields are display

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 8 months ago #160960 by Krikor Boghossian
Replied by Krikor Boghossian on topic Link field
You have the wrong alias.
The correct one is bateau (as per the var_dump)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • yannick berges
  • yannick berges's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 8 months ago #160982 by yannick berges
Replied by yannick berges on topic Link field
yes .... i am stupid sorry !

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 8 months ago #160984 by Krikor Boghossian
Replied by Krikor Boghossian on topic Link field
No worries buddy :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum