For example we use this technique to display lists within lists:
Let's say you have two lists: List_A and List_B and you want to display list_B within each item of list_A
So in your LIST_A item view you just have three fields:
a text field nammed 'list_b'
a php before render code field:
// get the id of the current item from list_A
$id = $fields['art_id']->value;
// we build the URL of the type B list filtered according to the A item
// of course it means you already created the list_B with a live value (button (2) ) upon a field that will use one of the url variable (here 'id_a' for the example)
$url = JURI::base().'index.php?option=com_cck&view=list&search=list_b&task=search&tmpl=raw&id_a='.$id;
// we get the content of the url
// and you display it within the text 'list_b' field
$content = file_get_contents($url);
to have the &tmpl=raw working you need to create a raw.php file at the template root folder. This raw.php file should only contains:
// no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); ?> <jdoc:include type="component" />
I tried to follow your instructions but it doesn't work. I think I haven't understood how the raw template works:
If I test this link directly in my browser ($url = JURI::base().'index.php?option=com_cck&view=list&search=list_b&task=search&id_a='.$id ) it displays correctly my list b. But if I add '&tmpl=raw' the page is blank and the content is empty.
Of course I put the raw.php file in the templateS directory.