Display link to file for each dropdown element item

Discussion in 'Standard Support' started by greif, Jul 27, 2011.

Thread Status:
Not open for further replies.
  1. greif New Member

    Level: Community
    Hi, I have 1000 items in the table, which belong to 5 categories. I have a default document for each category, and would to display it when clicked on the category name. How can I achieve this? Thanks
  2. greif New Member

    Level: Community
    I made some progress: I did another table with file upload element, I uploaded the 5 files I have to display for each category, and added join element to the original table to display the files in form and in table. It works, but I don't get link on the join element to the file.

    I came across this thread, which could have something to do with this http://fabrikar.com/forums/showthread.php?t=21810 , but wasn't able to figure out myself how to set it up to display the join element as link to the original file.

    Any ideas?
    Thanks
  3. pfleischman New Member

    Level: Community
    When you say 'default document' do you mean you want to display a link to a file?
  4. greif New Member

    Level: Community
    Yes. What I need is to display the category name the item belongs to, and when clicked on the category name, open the appropriate file.
  5. pfleischman New Member

    Level: Community
    If it is a static file, i'd just take the image element and then create a link to the actual file on your site. That seems like the easiest way.
  6. greif New Member

    Level: Community
    OK, I put an image element into the table, I can select the appropriate image, but in the table it just displays the name of the image, without link to it.
  7. pfleischman New Member

    Level: Community
    Check out my screen shot then go to the element and select 'yes' under 'show in table'. Then go to 'table settings' (next to publish on the right) and put in the hard link to the file. If you want to display the item in a javascript popup, just let me know and I'll throw you the code.

    Attached Files:

  8. greif New Member

    Level: Community
    Yes, this could work in the case I would have just one image/document to display. But, as I said, I have 5 images/documents now, with more coming soon. So, adding a single image element to the table and hardcoding the link won't be enough in my case...
  9. cheesegrits Support Gopher

    Level: Community
    if I'm understandign what you need correctly, you should be able to do this with the 'CONCAT' label option on your join element. Assuming the upload element on the table you are joining to is called 'cat_file', and there is also an element with the cat name called 'cat_name' ....

    Code (text):
    '<a href="', {thistable}.cat_file, '">', {thistable}.cat_name, '</a>'
    Leave {thistable} unchanged, just change the cat_file and cat_name fields to suit.

    -- hugh
    1 person likes this.
  10. greif New Member

    Level: Community
    Hi, thanks, this almost works. There are two problems - when I click on the link, i get ie. localhost/images/protokoly/ac30-1.jpg, instead of localhost/joomla/images/protokoly/ac30-1.jpg. I suppose this is because the data in file upload element is stored as /images/protokoly/ac30-1.jpg

    Another, bigger problem, is, when I have uploaded more than one file, I get ie. /images/protokoly/apb1a.jpg</li><li>/images/protokoly/apb2a.jpg as a link.

    So, I was thinking about another option - when I would click on the link, it would take me to the appropriate table (Protokoly) and a correct row.

    When I use this code in 'CONCAT' label on join element

    Code (text):
    '<a href="', {thistable}.id, '">', {thistable}.id, '</a>'
    it takes me to http://localhost/joomla/18 . I would like to have the link

    http://localhost//joomla/index.php?...resetfilters=0&Itemid=57&protokoly_hp___id=18

    Can I do this with the Concat label? Or is there easier way to do this? Thanks
  11. greif New Member

    Level: Community
    Got it:
    Code (text):
    '<a href="index.php?option=com_fabrik&view=table&tableid=9&calculations=0&resetfilters=1&Itemid=57&protokoly_hp___id=', {thistable}.id, '">', {thistable}.id, '</a>'
    Thanks for your help!
Thread Status:
Not open for further replies.

Share This Page