Hi,
I created a custom template for the frontend display but I can't find how to create an "Order by" field with multiple options in the header.
Plus I have an issue creating a condition using PHP. My PHP seems correct to me but doesn't work at all. It's supposed to show a "No picture" image when the image field is empty. Here's the code :
Thank you for your help !
Quentin
I created a custom template for the frontend display but I can't find how to create an "Order by" field with multiple options in the header.
Plus I have an issue creating a condition using PHP. My PHP seems correct to me but doesn't work at all. It's supposed to show a "No picture" image when the image field is empty. Here's the code :
<?php
$image = '{Barrier.image}';
if( $image == "" ) { echo '<img style="float:left; border:1px solid silver;" src="/components/com_chronocontact/uploads/nofile.jpg" />';
} else {
echo '<img style="float:left; border:1px solid silver;" src="/images/barriers/{Barrier.image}_big" />'; }
?>
Thank you for your help !
Quentin
Hi Quentin,
Sorry, I don't understand the header problem.
The second one is probably because you can't use the {} syntax inside <?php . . . ?> tags; use the PHP variable name instead. I think that is now $row so $row['Barrier']['image'] but I can't see it in any of the FAQs :-(
Bob
Sorry, I don't understand the header problem.
The second one is probably because you can't use the {} syntax inside <?php . . . ?> tags; use the PHP variable name instead. I think that is now $row so $row['Barrier']['image'] but I can't see it in any of the FAQs :-(
Bob
Hi Bob,
Thank you for your answer, I changed the variable value to $row['Barrier']['image'] and it works.
Sorry if I wasn't clear on my header problem. I have a custom display with a search in the header, I would like to add a select field for users to choose the ordering option of the displayed list.
Quentin
Thank you for your answer, I changed the variable value to $row['Barrier']['image'] and it works.
Sorry if I wasn't clear on my header problem. I have a custom display with a search in the header, I would like to add a select field for users to choose the ordering option of the displayed list.
Quentin
Hi Quentin,
I don't know how to do that - though it is probably possible.
You can use the Sortables box in the setup to set up column headers that will sort when clicked - similar to the Joomla! Admin sortable columns. Would that work?
Bob
I don't know how to do that - though it is probably possible.
You can use the Sortables box in the setup to set up column headers that will sort when clicked - similar to the Joomla! Admin sortable columns. Would that work?
Bob
Hi Bob,
Couldn't find a way to use the Sortable box, they change the order of the articles but I can't switch from one to another on the frontend.
Quentin
Couldn't find a way to use the Sortable box, they change the order of the articles but I can't switch from one to another on the frontend.
Quentin
Hi,
If the field name is in the "Columns list" and is in the "Sortable" then using the field name between curly brackets in the "header" box should display a sorting link!
Regards,
Max
If the field name is in the "Columns list" and is in the "Sortable" then using the field name between curly brackets in the "header" box should display a sorting link!
Regards,
Max
This topic is locked and no more replies can be posted.