8 years ago
Topic

Hi,

I'm beginner with SEBLOD, so my question is perhaps very simple, but for me very difficult :)

I have created a GroupX with 3 components:

1- Dynamic selection list which display list of title of articles with as value name, the id of article.

2- Text (associated free value)

3- Button (detail button) This button should display the article selected by Dynamic Selection List into a new navigator Tab

I don't understand how I can call with this button the right article, in fact how build the URL and associate the URL on the button. I also not sure what kind of button that must be used. I think that I should call a PHP script with a command as:
$cck->get("groupx_field")->value;

Could you help me?
Thank you in advance.
Gérard

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
1
Level 1

Hi,

you need this

https://www.seblod.com/store/extensions/921

There you can select redirect to view, based on other fields value, field 1 in your case

If you might need to pass aditional values see attached tutorial

8 years ago
0
Level 2

Hi Klas,

   Thank you for your help. Components are installed, I have added a button Submit to the GroupX, use the type "free" for this button. For Link have selected custom and click on the +. Into "construction Area", I have filled the field Link with expected URL as for example:

/monsite/gestionnaire-base/form/huilebase?id=16   --> The expected article is opened :)

Now how I can replace the value 16 by the value of the groupX component "liste de selection dynamique" associated to this button ? 

If for example the component is named "name-article", what is the right syntax? I have tried lot of possibility without success 

(for example: ?id=$get['name-article']->value['id'] ). I understand than this syntaxt is not right because the GroupX 'name-article' is an array, but how I can know the id of the 'name-article' object ?

eg of screen:

                                                                                         - + .

article:    toto   <-- this is a "liste of selection dynamique"

Button Detail: (should call article toto)

value : "free text"

                                                                                         - + .

article: tata <-- this is a "liste of selection dynamique"

Button Detail: (should call article tata)

value : "free text"

I hope than me explanation is enough clear.  

Thank in advance for your help.

Gérard

 

4229 Posts
Kadministrator
8 years ago
1
Level 1

Hi,

first, you need to have articleid as value in your select dynamic, you can't open article by name (use title as text, id as value )
Then, as you have button inside your groupx it should be able to get its value from your select dynamic normally, so $cck->get('select_dynamic_name');

But you don't need this, there is view link in custom button that has a setting "fields" where you can enter your select dynamic's name and it should take its value and build link automatically.

8 years ago
0
Level 2

Hi,

Thank you Klas.

After lot of try, I think that I'm near of the solution. :)

Kind of Button added into the groupX -> submit button

button parameter:

Type -> free

Link -> Seblod Form

When I click on + into additional parameter, I have filled as bellow

Group construction:

Type of content -> Field

Menu Item -> -Herité- . I have also tried with the name of the menu used to list the article without success

Field Name -> The name of the groupX dynamic list field (co_oil_composition_grpx_oil_name)

Redirect -> Automatic

The URL called is the following:

http://......../index.php?option=com_cck&view=form&layout=edit&type=#co_oil_composition_grpx_oil_name#&Itemid=143&return=......

Not than the Itemid is the item of menu

The expected URL is:

http://........./gestionnaire-huiles-de-base/form/huilebase?id=16&return=.....

The components "co_oil_composition_grpx_oil_name" used the table article with parameters:

- Option name : tilte

- Option value : id

I hope than I have send you necessary information, but I don't understant what are the right parameter the have the good URL.

Thank you for your help.

Gérard

4229 Posts
Kadministrator
8 years ago
1
Level 1

As I wrote in my previous answer - you need button free NOT submit button

8 years ago
0
Level 2

Hi Klas,

I think than we talk about same component, my explanation is not clear. To be sure I describe below how I install and used the free button:

1) Free button download and installed (link: button free)

2) same for custom lin (component : custom link)

3) Into the site view of my "Formulaire & type de contenu", into Mainbody Part, I have listed component from "Core List", Free button is not into the list, so, I have added a button (submit button for example) and into button parameter selected Type free. So the button is listed in view site as Free button (text grayed). 

If my understanding is right, this button is now a free button. Is it correct? 

Thank you for your answer.

Gérard

4229 Posts
Kadministrator
8 years ago
1
Level 1

No, it is not correct.

"Free button is not into the list"

You need to click on big + in the field list area and create new field, select Button->free as your field type.

8 years ago
0
Level 2

Hi Klas,

   I have created free button as new field from the big + in the list area. I have filled fields with same parameters:

When I click on + into additional parameter, I have filled as bellow

Group construction:

Type of content -> Field

Menu Item -> -Herité- . I have also tried with the name of the menu used to list the article without success

Field Name -> The name of the groupX dynamic list field (co_oil_composition_grpx_oil_name)

Redirect -> Automatic

When I click on the button, the URL called is the following:

http://......../index.php?option=com_cck&view=form&layout=edit&type=#co_oil_composition_grpx_oil_name#&Itemid=143&return=......

Not than the Itemid is the item of menu

The expected URL is:

http://........./gestionnaire-huiles-de-base/form/huilebase?id=16&return=.....

The components "co_oil_composition_grpx_oil_name" used the table article with parameters:

- Option name : tilte

- Option value : id

I don't understant what are the right parameter the have the good URL.

Thank you for your help.

Gérard

4229 Posts
Kadministrator
8 years ago
3
Level 1

Hi,

Solution is a bit more complicated as I thought initally, only way I found that works is to do it with javascript, I made a tutorial

8 years ago
2
Level 2

Hi,

   Thank you very much for your help. If it is more easy for you I can give you access to the current site onto developement environment.

Gérard

4229 Posts
Kadministrator
8 years ago
1
Level 3

You should be able to do it following the above tutorial, if not you can use seblod service

8 years ago
0
Level 4

Hi,

   The button work as expected. Thank you very much for your help.

Gérard

Get a Book for SEBLOD