Hey hey. I haven’t posted in a while. I have been really busy doing some of the Codecademy stuff. And I have been learning a lot about Rules and some of the more granular ways to choose content on my site.
That brings me to today’s topic. I have One content type called research. I need to be able to use this content type on more than one node add/edit form for that one content type. So, I have one variant on the Node Add/Edit page in Page Manager. I thought that it might best to setup two variants at first then use some selection rules to choose based on the URL.
I looked at a few different ways to do this and the one that I have settled on is this. I have one variant. I need to have one Panel on the page that is different from the other. So, I use a visibility rule for one panel and a different one for the other. Then, I placed both of those Panels on the page. Since it is a Node ADD/Edit variant, I have to work in the URL, node/add/research. so the rule for one panel is node/add/research/news and the other is node/add/research/courts. I created a menu that reflects these URLs and now I can get to the correct version of the one variant from URL selection rules on two different panel panes.
So I have Forums, Blogs and Galleries. And I want to style each one differently. So my first thought is to put the form inside of a Panel Page so that I can add other content. And that is the right direction, but it isn’t enough.
The Node Add/Edit form is already in the Page Manager as a Panel Page. It is disabled by default. By enabling it, I will have the ability to customize the form’s display. I already explained the part about the contexts
method of determining what node type will be affected by the change. But here is something to keep in mind.
If you enable the page, and then create a variant for a content type to be used (when you add a node to that content type for example) you will find that the add form for ALL content types looks like the variant you created for example, for the Blog entry content type.
You will need to create a variant for each of the content types individually or they will all inherit the one variant’s customizations. and what I had to do to make THAT work properly was to use a selection rule for the variants that come at the beginning of the list. Since variant order determines in a large part, what is applied, you have to create selectors so that the “filtering” process works properly.
This is one of Drupal’s great strengths, but it is also kinda strange to me and took a while for me to get my head around. Look at the SS. Each of the three content types has a variant. and a context that applies to it. But, without a Selection Rule that also applies to it, the variant will simply inherit its appearance from a rule above it, the first one that happens to apply. There are other ways to do these same things with selection rules