single item not present as menu item #595

Closed
opened 2020-09-03 13:10:59 +00:00 by studio16 · 25 comments
studio16 commented 2020-09-03 13:10:59 +00:00 (Migrated from github.com)

single item not present as menu item although "add a menu" is checked in the site views (getItem) of the component

single item not present as menu item although "add a menu" is checked in the site views (getItem) of the component

@studio16
I've checked this area out and it works perfectly fine on the current JCB version(12.11.4), could you please share more information related to this issue or steps on how it can be reproduced?

@studio16 I've checked this area out and it works perfectly fine on the current JCB version(**12.11.4**), could you please share more information related to this issue or steps on how it can be reproduced?
studio16 commented 2020-09-04 12:55:07 +00:00 (Migrated from github.com)

there is a Menu-itemtype to the list view in the menumanager but no Menu-itemtype to a single item view in the menu manager

there is a Menu-itemtype to the list view in the menumanager but no Menu-itemtype to a single item view in the menu manager
studio16 commented 2020-09-04 12:57:09 +00:00 (Migrated from github.com)

the "add menu" in the component's site view is checked at the single item (in my case "event") but does not appear in the menumanager

the "add menu" in the component's site view is checked at the single item (in my case "event") but does not appear in the menumanager

When you select a Menu Item Type, you first select the Component that you are working on then choose the menu item from the drop down

When you select a Menu Item Type, you first select the Component that you are working on then choose the menu item from the drop down
studio16 commented 2020-09-04 13:11:52 +00:00 (Migrated from github.com)

yes and than i have ONLY the list view and NOT the single item menu item

yes and than i have ONLY the list view and NOT the single item menu item
studio16 commented 2020-09-04 13:14:59 +00:00 (Migrated from github.com)

i would have assumed there would be a menu item possibilty attached to a single item id

i would have assumed there would be a menu item possibilty attached to a single item id

Nope, I am afraid that functionality has not been available yet..

Nope, I am afraid that functionality has not been available yet..
studio16 commented 2020-09-04 13:28:18 +00:00 (Migrated from github.com)

thought so since the xml in the frontend view is also as good as empty, wow no fields, i willa dd them myself, no problem but it would be a nice option. Besides the "add menu" has no meaning now on single item views

thought so since the xml in the frontend view is also as good as empty, wow no fields, i willa dd them myself, no problem but it would be a nice option. Besides the "add menu" has no meaning now on single item views

This link will help you add a form to a site view..

This [link](https://youtu.be/UVICsD82oWk) will help you add a form to a site view..
studio16 commented 2020-09-04 14:48:46 +00:00 (Migrated from github.com)

I think u add a comment to the wrong issue. This is about using a xml for menu type creation and has nothing to do with adding a form to anything. Again i will add it myself, been doing it for 15 years now ;-)

I think u add a comment to the wrong issue. This is about using a xml for menu type creation and has nothing to do with adding a form to anything. Again i will add it myself, been doing it for 15 years now ;-)
studio16 commented 2020-09-23 15:06:51 +00:00 (Migrated from github.com)

actually it woulf be a big a deal to add it, asuming there is always an id and some kind of title as a column
in the default.xml of the view we need to add:





And in the model, populateState we add:

$params_array = $params->toArray();
if (isset($params_array['item_id']))
{
$this->setState('question.id', $params_array['item_id']);
}

Can this be done somehow via jcb so we don't need to redo things manually on update component?

actually it woulf be a big a deal to add it, asuming there is always an id and some kind of title as a column in the default.xml of the view we need to add: <fields name="params"> <fieldset name="basic" label="LABEL"> <field name="item_id" query="SELECT `title`, `id` FROM #__db_table ORDER BY `id`" type="sql" key_field="id" value_field="title" label="LABEL" require="true" description="JGLOBAL_SHOW_TITLE_DESC"> </field> </fieldset> </fields> And in the model, populateState we add: $params_array = $params->toArray(); if (isset($params_array['item_id'])) { $this->setState('question.id', $params_array['item_id']); } Can this be done somehow via jcb so we don't need to redo things manually on update component?
studio16 commented 2020-09-23 15:07:45 +00:00 (Migrated from github.com)
 <fields name="params">
        <fieldset 
            name="basic"
            label="LABEL">
            <field
                name="item_id"
                query="SELECT `title`, `id` FROM #__db_table ORDER BY `id`"
                type="sql"
                key_field="id" 
                value_field="title"
                label="_LABEL"
                require="true"
                description="JGLOBAL_SHOW_TITLE_DESC">
            </field>
        </fieldset>
    </fields>
``` <fields name="params"> <fieldset name="basic" label="LABEL"> <field name="item_id" query="SELECT `title`, `id` FROM #__db_table ORDER BY `id`" type="sql" key_field="id" value_field="title" label="_LABEL" require="true" description="JGLOBAL_SHOW_TITLE_DESC"> </field> </fieldset> </fields> ```
studio16 commented 2020-09-23 15:08:48 +00:00 (Migrated from github.com)

latest is the default xml additional code which got lost in previous comment

latest is the default xml additional code which got lost in previous comment
studio16 commented 2020-10-08 11:39:37 +00:00 (Migrated from github.com)

this should be re-opened

this should be re-opened

Okay I read over the issue, and I am still not sure what you are trying to do.

JCB has an option to add item id's to a menu. Have you done this, or ar you trying to do this and no success.... or what is the issue here.

Okay I read over the issue, and I am still not sure what you are trying to do. JCB has an option to add item id's to a menu. Have you done this, or ar you trying to do this and no success.... or what is the issue here.
studio16 commented 2020-10-08 19:07:29 +00:00 (Migrated from github.com)

what i want to do is:
we have 2 menu items,
1 list view which shows all db entries
1 single item view
in my case
index.php?option=com_studiosixteeneventmanager&view=event
index.php?option=com_studiosixteeneventmanager&view=events
the single item view will never go to a single item since there is no id to select in the menumanager
Therefor we need to add an extra field in the default.xml to gives us a dropdown of single items id's
For instance:

<fields name="params"> <fieldset name="basic" label="LABEL"> <field name="item_id" query="SELECT title, idFROM #__db_table ORDER BYid" type="sql" key_field="id" value_field="title" label="_LABEL" require="true" description="JGLOBAL_SHOW_TITLE_DESC"> </field> </fieldset> </fields>

This gives us a dropdown select in the menumanager with, in this case the id and title (in case there is no title u cold choose to use id for key and for value)

This will add a single item id to the url.
now i have:
index.php?option=com_studiosixteeneventmanager&view=event
with the modification it will be
index.php?option=com_studiosixteeneventmanager&view=event&id=23
Only thing we need to do than is to modify the single event model

And in the model, populateState we add:

$params_array = $params->toArray();
if (isset($params_array['item_id']))
{
$this->setState('question.id', $params_array['item_id']);
}

These 2 modification give the user a single item menu type assign to actually a single event.
Maybe it can be done somehow via JCB but i havent't found it yet.

what i want to do is: we have 2 menu items, 1 list view which shows all db entries 1 single item view in my case index.php?option=com_studiosixteeneventmanager&view=event index.php?option=com_studiosixteeneventmanager&view=events the single item view will never go to a single item since there is no id to select in the menumanager Therefor we need to add an extra field in the default.xml to gives us a dropdown of single items id's For instance: `<fields name="params"> <fieldset name="basic" label="LABEL"> <field name="item_id" query="SELECT `title`, `id` FROM #__db_table ORDER BY `id`" type="sql" key_field="id" value_field="title" label="_LABEL" require="true" description="JGLOBAL_SHOW_TITLE_DESC"> </field> </fieldset> </fields>` This gives us a dropdown select in the menumanager with, in this case the id and title (in case there is no title u cold choose to use id for key and for value) This will add a single item id to the url. now i have: index.php?option=com_studiosixteeneventmanager&view=event with the modification it will be index.php?option=com_studiosixteeneventmanager&view=event&id=23 Only thing we need to do than is to modify the single event model And in the model, populateState we add: $params_array = $params->toArray(); if (isset($params_array['item_id'])) { $this->setState('question.id', $params_array['item_id']); } These 2 modification give the user a single item menu type assign to actually a single event. Maybe it can be done somehow via JCB but i havent't found it yet.

Okay what you are trying to do is already in JCB, but not that obvious, and not always needed in the way you are trying. But it is in JCB in both ways, and works very well.

For me to explain it here is hard, really hard. So we have two options, lets arrange a live session for the JCB community to ask me questions, and give answers in a like a open forum, and or just make tutorial, or just point you to tutorials that already deal with this indirectly.

But I know we will need to find some way to communicate this more clearly with everyone. Seeing that this is a simple task many would be trying to achieve. I know I touch on this in the Hello World Tutorial..., and a few others. But noting exclusive is yet been done. But you are the second person to ask for help with this in the last two weeks.

Okay... so let me know? arrange a JUG...JCB_JUG online, and or just make another tutorial, and or just point you to existing explanations.

Okay what you are trying to do is already in JCB, but not that obvious, and not always needed in the way you are trying. But it is in JCB in both ways, and works very well. For me to explain it here is hard, really hard. So we have two options, lets arrange a live session for the JCB community to ask me questions, and give answers in a like a open forum, and or just make tutorial, or just point you to tutorials that already deal with this indirectly. But I know we will need to find some way to communicate this more clearly with everyone. Seeing that this is a simple task many would be trying to achieve. I know I touch on this in the Hello World Tutorial..., and a few others. But noting exclusive is yet been done. But you are the second person to ask for help with this in the last two weeks. Okay... so let me know? arrange a JUG...JCB_JUG online, and or just make another tutorial, and or just point you to existing explanations.
studio16 commented 2020-10-09 08:10:58 +00:00 (Migrated from github.com)

perhaps because of the different timezones for now better if u point me to the current tutorial ;-)

perhaps because of the different timezones for now better if u point me to the current tutorial ;-)

Okay I opt for the new tutorial.. seeing this issue is very important and I want other to find the path easier then opening an issue on GitHub.

So it is still uploading, but please watch when its ready, and let me know if this resolved your issue.

Okay I opt for the [new tutorial](https://youtu.be/tgtonbyyjDs).. seeing this issue is very important and I want other to find the path easier then opening an issue on GitHub. So it is still uploading, but please [watch](https://youtu.be/tgtonbyyjDs) when its ready, and let me know if this resolved your issue.

I assume this is resolved...

I assume this is resolved...
studio16 commented 2020-10-12 08:00:18 +00:00 (Migrated from github.com)

i have been able to add the field wth the correct dropdown, i added display:menu but the dropdown is only available on the config page instead of the menu page. I will do some more test later on, thanks for now.

i have been able to add the field wth the correct dropdown, i added display:menu but the dropdown is only available on the config page instead of the menu page. I will do some more test later on, thanks for now.
studio16 commented 2020-11-06 18:12:28 +00:00 (Migrated from github.com)

display:menu will not add it to the menu, only to the config of the component
This is therefor not resolved

display:menu will not add it to the menu, only to the config of the component This is therefor not resolved

Did you watch this https://youtu.be/tgtonbyyjDs, and have you looked at sermon distributor. Since it does add it to the menu and in fact you are able to chose both or target just one or the other.

If this is really still un resolved you will need to add a video recording of the issue, or very detailed screen-shots.

Did you watch this https://youtu.be/tgtonbyyjDs, and have you looked at sermon distributor. Since it does add it to the menu and in fact you are able to chose both or target just one or the other. If this is really still un resolved you will need to add a video recording of the issue, or very detailed screen-shots.

So if after looking at this tutorial, and checking the SD implementation, your still seeing an issues, then we are not on that same page. We are clearly not speaking of the same thing, and so misunderstanding is at play. So please do not take offense, but give better and clearer explanation so we can get this behind us. Video recording of what you are trying to do... the path you are following, and the outcome with as much detail as you can give... this is what we need.

So if after looking at this tutorial, and checking the SD implementation, your still seeing an issues, then we are not on that same page. We are clearly not speaking of the same thing, and so misunderstanding is at play. So please do not take offense, but give better and clearer explanation so we can get this behind us. Video recording of what you are trying to do... the path you are following, and the outcome with as much detail as you can give... this is what we need.
studio16 commented 2020-11-11 20:04:48 +00:00 (Migrated from github.com)

It's kind of hard to listen to audio and watching screens flashing before your eyes without the possibility to see where you are. I end up adding a custom field named question_request_id and display:menu.
What i am trying to do is what i normaly do in minutes by adding a xml of the view with some fields (in this case a sql type since i need the id of a record in a dropdown select) to get the url for a single record view.

It got added to the config page (unwanted, since i choose display:menu)
https://tinyurl.com/y28qtobk

An not to the single menu item view
https://tinyurl.com/y2hbvzw9

Complete page of the field settings
https://tinyurl.com/y45hb8ay

It's kind of hard to listen to audio and watching screens flashing before your eyes without the possibility to see where you are. I end up adding a custom field named question_request_id and display:menu. What i am trying to do is what i normaly do in minutes by adding a xml of the view with some fields (in this case a sql type since i need the id of a record in a dropdown select) to get the url for a single record view. It got added to the config page (unwanted, since i choose display:menu) https://tinyurl.com/y28qtobk An not to the single menu item view https://tinyurl.com/y2hbvzw9 Complete page of the field settings https://tinyurl.com/y45hb8ay
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#595
No description provided.