backdrop-ops / backdropcms.org

Issue tracker for the BackdropCMS.org website
https://backdropcms.org
25 stars 21 forks source link

backdropcms.org /user-guide/layouts #271

Open serundeputy opened 8 years ago

serundeputy commented 8 years ago

On the user-guide page /user-guide/layouts, in the Layout visibility conditions section, it says:

If the user does not have access Backdrop will return a "Page not found" error.

Is that true? I think it would be a 403 and if it is not it should be. So, I think we either have to change the user-guide (here /backdrop-ops/backdropcms.org) or file an issue against core (/backdrop/backdrop-issues).

thanks, ~Geoff

Graham-72 commented 8 years ago

@docwilmot congratulations for this description of Layouts - in my opinion perhaps the most difficult topic for Backdrop end users - if they ever attempt it.

I have just worked my way through applying a layout to a view and have found some difficulty in reaching my objective, and I think it is worth recounting here.

I am moving an existing site from D7 to Drupal. The site contains data records for events organised by my client. There are views to show listings of the events and to promote forthcoming events. There is also a view to show a report of an event - screenshot of evolving Backdrop version shown below.

The URL for each of these reports is eventreport/[nid] and in the view there is a contextual filter Content: Nid and the page settings path is /eventreport/%. This is all as for D7. It becomes more complicated when applying a layout in Backdrop.

In Backdrop the default layout would show this view without further effort. However, I wanted to use a different layout and here I hit difficulties. In the new layout the path on the settings page has got to be set to eventreport/% but when I did this I found the edit layout page did not show the main page content as one of the options for displaying in the layout. mainpagecontent

However, when on the settings page I set the path to node/% I was shown this option. So I temporarily saved my new layout with node/% as the path.

Then, in the edit layout page, I needed to configure the main page content block with a visibility condition URL = eventreport/* and save this configuration.

I then went back to the layout setting page and changed the path to be eventreport/% and after this change it works as required.

docwilmot commented 8 years ago

This seems to work for me though:

Did I do same as you?

Graham-72 commented 8 years ago

Yes, that is what I was doing. But the main page content was not available in step 6, until I used the (incorrect) wildcard path node/%

What wildcard path were you using?

Maybe I should try with a freshly created view rather than one imported from D7.

Graham-72 commented 8 years ago

Yes, with a freshly created view it is working OK, and it is picking up the main page content. Panic over!