Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

How to use a picto for link to item 19 Dec 2013 15:06 #11819

Hello,

I'll try to make it simple and clear...

I would like to make a link to a page (item) from a list (collection). Cook is doing that well with this code :
echo JDom::_('html.fly', array( 'dataKey' => 'descriptionField', 'dataObject' => $row,
				'route' => array('view' => 'objectitem','layout' => 'objectpageen','cid[]' => $row->id)));

My question : I would like to do the same thing with an image instead of the field's content. How could I do that ?

I already search this forum and the docs...

Thanks in advance,
Best regards,
Fred

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

Last edit: by Frederic.

How to use a picto for link to item 19 Dec 2013 16:04 #11820

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 132
  • Thank you received: 19
Hi,

is it not the same process? If you need to display only image on sepereate page just create fly page with image and modify properties of the image in collection.
Or you need modal window so just select modal in properties of the image in collection layout.

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

How to use a picto for link to item 19 Dec 2013 16:58 #11821

Hi etc,

Thank you for answering. I think my question is not clear.

The code I inserted comes from a list where it generates a clickable text. On this principle, I want to build the route to link a picto in that list to target the page item.

I was searching for a documentation of JDom where I could see its regular syntax. Do you know if it has been published ?

Thansk again,
Best regards,
Fred

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

How to use a picto for link to item 19 Dec 2013 18:06 #11822

Here is my "dirty solution" :
<td class="tableObjectGC7">
 <div class="qqtv">
  <a href="<?php echo JURI::Base(true).'/index.php/menuName/objectitem/objectpage?cid[0]='.$row->id ?>">
   <img src='<?php echo $pathAndNameOfMyPict; ?>'>
  </a>
 </div>
</td>

I Have added this to each row of my grid. It is working fine but I am sure that there is a more pro solution...

So I am still searching a better way.

Thanks in advance,
Best regards,
Fred

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

How to use a picto for link to item 19 Dec 2013 20:36 #11826

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Well, Cook encourages to access images indirecly when it is content, if it is only an icon, or something else, you can show complete path.

So
Just instance an image in your grid. It will use indirect access.
Then, simply add the 'route' array in the JDom params.
'route' => array('view' => 'objectitem','layout' => 'objectpageen','cid[]' => $row->id)

It can apply almost on all JDom calls.
This is one of the power of JDom : inheritance.

Hope it helps.
Coding is now a piece of cake

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

How to use a picto for link to item 19 Dec 2013 21:23 #11827

Hi Admin,

Thank you for your help.

What do you mean by "Just instance an image in your grid" ? So far, in the columns of a grid, I have been able to insert fields from the table. How can I insert an image that would not be from the table ?

Best regards,
Fred

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

How to use a picto for link to item 20 Dec 2013 20:17 #11830

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I mean your code is calling a html.fly.image JDom class.

To do that, in the builder, instance the image field. It can be behind a FK.

Regenerate and just extract the changed template file.

Note this is the way when image is dynamic. (The name is indexed in a field)

For static images, use CSS. Better.
Coding is now a piece of cake

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

How to use a picto for link to item 23 Dec 2013 15:54 #11842

OK. I'll try it.
Thank you !

& happy new year...

Best

Fred

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

  • Page:
  • 1
Time to create page: 0.104 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started