5 Posts
Felix
7 years ago
5
Topic

Hi all,

I'm looking for a possibility to get some Group X Values in a template but NOT from the ACTUAL ARTICLE.

I search a lot an found that I can get the values of standart fields with this code:


$seb_a= JCckContent::getInstance(array( 'joomla_article' , ARTIKEL ID));
$title = $seb_a->get('title');


That works fine now I will get the values from a group X Field:

$seb_a= JCckContent::getInstance(array( 'joomla_article' ,ARTIKEL ID));
$title = $seb_a->get('xg_article');


So I get the unfiltert result from the DB table.

::xg_article::1::/xg_article::
::cck_xg_article::xg_article_images::/cck_xg_article::
::article_sh_type|0|xg_article::0::/article_sh_type|0|xg_article::
::article_sh_media_type|0|xg_article::0::/article_sh_media_type|0|xg_article:: ....


So I come back to my question:

How can I get the Group X Values for Example in an array or with "get" how I done in it normaly? 

article_sh_type= ....

article_sh_media_type= ...



Thanks a lot!



Get a VIP membership
4229 Posts
Kadministrator
7 years ago
1
Level 1

5 Posts
Felix
7 years ago
0
Level 2

Thx Klas for your post. But I know this site and it's not helping me actually.

$cck->renderField( 'your_fieldx_or_groupx' );

Or in other words. I want to know how I get the "$cck" Object for an Article (for example with ID 6). 

Because I'm actually in an Article Template but need an Group X value from another article.

I hope this is quite simpel.

4229 Posts
Kadministrator
7 years ago
1
Level 1

Hi,

I misunderstood your question - to get array out of raw database result you can use CCK_Content::getValues($rawvalue);

5 Posts
Felix
7 years ago
0
Level 2

Ok that's help me a littel bit. It's no other way.


Any solution for getting this values more earsier? Like: 

$cck=GET_ARTICLE_BY_ID("ARTICEL_ID");

$a_items=$cck->get('xg_article')->value;

foreach($a_items as $a_item)
{
echo $a_item['article_sh_type']->value;
}

 


4229 Posts
Kadministrator
7 years ago
0
Level 1

If you do var_dump($seb_a) you will be able to see exactly what is contained in the

$seb_a= JCckContent::getInstance(array( 'joomla_article' ,ARTIKEL ID));

If you still have problems, you can use

https://www.seblod.com/store/services

Get a VIP membership