Links on list1 (floating button) --> Edit: Edit list1, or Edit List2 - is possible?

Hi,

I need on my list1 to have 3 links --- in column with floating buttons --- :
- Details view link for list1
- Edit link for list1
- Edit link for list2

I use custom template for list1 and also custom template for list2 - this is the same template for both list1 and list2.

list 1 and list 2 have the same records from table:
ccjom_cc_kk_karta_rejestr___


How to get one link more , this one:
- Edit link for list2
 

Attachments

  • Zaznaczenie_105.png
    Zaznaczenie_105.png
    39.3 KB · Views: 383
If it has to be in the floating buttons you can add a php list plugin only redirecting to the edit link (+ hide all checkboxes).

Or you can use one element with a custom link.
Or you can do heavy string handling in your custom list template in default_row.php
 
But doesn't work {placeholder}.
I have added php plugin to my list.
Php code is:
PHP:
/* Redirect browser */
header("Location: http://candc.katowice.pl/index.php/
menu-karta-produkcji/adm-kp-mod-i-zatw-1/
form/320/{ccjom_cc_kk_karta_rejestr___id}/");
/* Make sure that code below does not get executed when we redirect. */
exit;

In browser line i get:
http://candc.katowice.pl/index.php/...w-1/form/320/{ccjom_cc_kk_karta_rejestr___id}

I should get for example:
http://candc.katowice.pl/index.php/menu-karta-produkcji/adm-kp-mod-i-zatw-1/form/320/51


How to write code in php plugin to get this in my browser?
 
Not sure if this is the correct redirect code (where is this coming from)?
But anyway
I don't think a text inside "" will be interpreted as a placeholder.
Try something like (I didn't test)
Code:
/* Redirect browser */
$loc = "Location: http://candc.katowice.pl/index.php/
menu-karta-produkcji/adm-kp-mod-i-zatw-1/
form/320/" . {ccjom_cc_kk_karta_rejestr___id} . "/";
header($loc);
/* Make sure that code below does not get executed when we redirect. */
exit;
 
Where are you doing this?
In the php code field directly in the php plugin?
Or in a php script file (your can't use placeholders there)?
 
In the php code field directly in the php plugin.

I try different possibilities : like your sample of code and like my sample of code.
Nothing not works.

I could use inline button also - this is not important.
But i need 3 links
details/view list1
edit list1
edit list2
 

Attachments

  • Zaznaczenie_110.png
    Zaznaczenie_110.png
    39.1 KB · Views: 389
Last edited:
The list PHP plugin doesn't do anything with placeholders, as no "form data" is submitted to list plugins, you just get the id's of the selected rows being processed. If you need data, you have to look it up yourself. If you look at another example of a plugin, like update_col, you can see how it does that:

Code:
        $ids = array_unique($input->get('ids', array(), 'array'));
        JArrayHelper::toInteger($ids);
        $this->row_count = count($ids);
        $ids = implode(',', $ids);
        $model->reset();
        $model->setPluginQueryWhere('update_col', $item->db_primary_key . ' IN ( ' . $ids . ')');
        $data = $model->getData();

... although that won't work exactly as is, it needs some other variables set up in the lines prior to that.

But that's an extremely heavy weight way of doing it, and doesn't work if someone selects more that one row.

I think your best bet is to do this in your template. In default_row.php you could add an action to $this->_row->fabrik_actions, something like ...

Code:
$myAction = '... some markup ... href="http://candc.katowice.pl/index.php/menu-karta-produkcji/adm-kp-mod-i-zatw-1/form/320/' . $this->_row->data->ccjom_cc_kk_karta_rejestr___id . '" ... more markup ...';
str_replace('</div>', $myAction . '</div>', $this->_row->data->fabrik_actions);

I can't give you the exact markup, as I don't have a 3.0 server to hand at the moment, and I don't know which method you are using for showing your links. But what you are aiming to do is build another link using the same markup as the others (add, edit), and insert it into the <div> used by the actions.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top