Struggling with adding URLs to main menu

93 views
Skip to first unread message

Amiramix

unread,
Sep 19, 2012, 5:10:54 PM9/19/12
to zotonic-d...@googlegroups.com
This is my n-th attempt to create a meaningful menu. For testing purposes I am trying to create a menu with a few URLs, e.g. http://www.google.com, http://www.twitter.com. I am either trying to click Add menu item and select Embed URL, or create a new page of category Website and add it to the menu. In any case the URL is being lost and when the item is being shown in the menu, clicking it actually refreshes the current page instead of redirecting to the specified URL. When I am trying to edit the specified Page the URL is nowhere to be found. I have the blog skeleton installed in which the menu works but it just shows a menu with three Text pages, all of which are internal Zotonic resources.

So, how can I add a menu item that will be an URL so that when the menu shows on the site I can click that URL and be redirected to it? And also, if I would like to construct a menu item that opens a controller within the site, say site/admin for the sake of an example, how would I need to create that menu item so that clicking it on the main site would actually redirect me to the admin section? A short example based on the blog skeleton would be greatly appreciated.

Amiramix

unread,
Sep 19, 2012, 5:15:30 PM9/19/12
to zotonic-d...@googlegroups.com
OK, I figured it out that I need to add a Page, select category Website, save it, reopen it and update the Path. It is kind of tricky that one can create Embed URL of category Website. What would be the purpose of that?

But anyway something still isn't working correctly. When adding the path as http://www.google.com the menu item tries to redirect me to site/http://www.google.com.... Is this a bug?

Marc Worrell

unread,
Sep 19, 2012, 5:20:23 PM9/19/12
to zotonic-d...@googlegroups.com
Did you set the URL in the 'website' field of the 'address' block?

There isn't support for adding a website redirect directly with the page creation dialog.
The Embed URL (etc) are for fetching media items from other sites using OEmbed.

- M

Amiramix

unread,
Sep 19, 2012, 5:44:27 PM9/19/12
to zotonic-d...@googlegroups.com

On Wednesday, September 19, 2012 10:20:35 PM UTC+1, Marc Worrell wrote:
Did you set the URL in the 'website' field of the 'address' block?

Setting the Website field doesn't work. The field is saved but the menu item still doesn't show the saved address. Only setting the Page path works, but then it assumes it's a path within the site, not an external URL.

There isn't support for adding a website redirect directly with the page creation dialog.

I would expect that when adding a Website page there should be a field to add at the same time the URL of that Website. Having to save and reopen for edit to set the address isn't too intuitive.
 
The Embed URL (etc) are for fetching media items from other sites using OEmbed.

But it still doesn't seem to make sense to save the fetched media items as some of the categories, e.g. Website or Person?
 

Marc Worrell

unread,
Sep 19, 2012, 5:58:56 PM9/19/12
to zotonic-d...@googlegroups.com
On 19 sep. 2012, at 23:44, Amiramix wrote:


On Wednesday, September 19, 2012 10:20:35 PM UTC+1, Marc Worrell wrote:
Did you set the URL in the 'website' field of the 'address' block?

Setting the Website field doesn't work. The field is saved but the menu item still doesn't show the saved address. Only setting the Page path works, but then it assumes it's a path within the site, not an external URL.

Is your page of the category 'website'?
And what modules do you have enabled?
In the mod_base_site dispatch rules there is a rule:

 %% Redirect controller for resource of type 'website'
 {website, ["redirect", id, slug], controller_website_redirect, []},

This one is not available in the mod_base.
Maybe you can add it to your site's dispatch rules?

We are still moving some dispatch rule definitions around for the 0.9 release.
This dispatch rule is one of the those moving around.

The page_path is indeed only valid within the site.


There isn't support for adding a website redirect directly with the page creation dialog.

I would expect that when adding a Website page there should be a field to add at the same time the URL of that Website. Having to save and reopen for edit to set the address isn't too intuitive.

That is true, it is now a generic form that doesn't adapt to the selected category.
That can be made better.


The Embed URL (etc) are for fetching media items from other sites using OEmbed.

But it still doesn't seem to make sense to save the fetched media items as some of the categories, e.g. Website or Person?

Does it allow you to choose the category?  
There is no category when you select "URL", "Embed code" or "Embed URL"
The category is derived from the media item found (image, video, document etc)

- Marc

Amiramix

unread,
Sep 19, 2012, 6:26:10 PM9/19/12
to zotonic-d...@googlegroups.com


On Wednesday, September 19, 2012 10:59:25 PM UTC+1, Marc Worrell wrote:

On 19 sep. 2012, at 23:44, Amiramix wrote:


On Wednesday, September 19, 2012 10:20:35 PM UTC+1, Marc Worrell wrote:
Did you set the URL in the 'website' field of the 'address' block?

Setting the Website field doesn't work. The field is saved but the menu item still doesn't show the saved address. Only setting the Page path works, but then it assumes it's a path within the site, not an external URL.

Is your page of the category 'website'?
And what modules do you have enabled?
In the mod_base_site dispatch rules there is a rule:

 %% Redirect controller for resource of type 'website'
 {website, ["redirect", id, slug], controller_website_redirect, []},

This one is not available in the mod_base.
Maybe you can add it to your site's dispatch rules?

We are still moving some dispatch rule definitions around for the 0.9 release.
This dispatch rule is one of the those moving around.

The page_path is indeed only valid within the site.

I think the problem is with what is being shown in the menu, not what happens when the menu item is clicked, e.g. currently the menu item looks like this:

                <li class="">
                    <a href="" class="" data-target="#">
                        Dashboard
                    </a>
                </li>

even thought Dashboard is defined as a page with category Website and with address/Website field set to http://www.google.com. I guess it may be because the Page path is empty.

Modules that are currently active:
mod_acl_adminonly,mod_admin,mod_admin_category,
mod_admin_config,mod_admin_identity,mod_admin_modules,
mod_admin_predicate,mod_authentication,mod_base,
mod_bootstrap,mod_development,mod_logging,mod_menu,
mod_oauth,mod_oembed,mod_search,mod_signal

 


The Embed URL (etc) are for fetching media items from other sites using OEmbed.

But it still doesn't seem to make sense to save the fetched media items as some of the categories, e.g. Website or Person?

Does it allow you to choose the category?  
There is no category when you select "URL", "Embed code" or "Embed URL"
The category is derived from the media item found (image, video, document etc)

That's true. But go to Content -> Menu and click Edit at a page added previously as Embed URL or Embed code. Now the category shows Document and can be changed to whatever one desires. It must be this way that I added www.google.com as an EmbededURL and changed its category to Website because I didn't know that to add the URL I need to create Page of category Website and then edit the Page to add the URL.
 

- Marc

Arjan Scherpenisse

unread,
Sep 21, 2012, 4:48:55 AM9/21/12
to zotonic-d...@googlegroups.com
I think what confusing is here, is that the "make new page" and "upload
media" dialogs have merged into one.
It's a good thing but I think if we change the wording to make sure that
the "URL" and "Embed code" refer to media pages, not to "generic" pages.

Marc Worrell

unread,
Sep 21, 2012, 11:28:44 AM9/21/12
to zotonic-d...@googlegroups.com
Yes indeed. Some wordings that we will make/download/extract a media item will clear things up.

-Marc

Sent from my iPhone

Gregory Haskins

unread,
Oct 26, 2012, 2:22:00 PM10/26/12
to zotonic-d...@googlegroups.com


On Friday, October 26, 2012 1:08:09 PM UTC-4, Gregory Haskins wrote:

Any help understanding what is going on or what I am doing wrong appreciated!



Hi again,

First off, sorry for top-posting earlier.  It seems I am a bit rusty posting to a forum.

I wanted to report that I figured out what I was doing wrong:  In the Website page editor, there is English->Website, which is editable.  This was where I was pasting the URL which was failing to persist.  After posting, i discovered there is also Address->Website further down.  Setting the URL in this position did three things: 1) it persisted, 2) it seemed to synchronize the English->Website field (perhaps this was meant to be a RO label not an editbox?), and 3) it works!

I look forward to exploring more, thanks for the cool project.

Kind Regards,
-Greg

Andreas Stenius

unread,
Oct 29, 2012, 4:23:58 AM10/29/12
to zotonic-d...@googlegroups.com
Hi Gregory, and welcome to the Zotonic community!

I'm glad you solved it. And you are right about the docs, which we are working hard on improving.
Thanks for sharing your findings.

Btw, top posting is common on this list, so no issue there.. :)

Cheers,
Andreas

2012/10/26 Gregory Haskins <gregory...@gmail.com>
Reply all
Reply to author
Forward
0 new messages