HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[SEMI-RESOLVED]Adding Panels to the layout

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#99111 (In Topic #19498)
Avatar

Community saint

Is there an easy way?

Before I spend the next few hours delving into source files etc to see what is possible I thought I would ask this:

Is it possible to add Panels to layout easily or will it require some significant code changes?

I would like to define some extra panels to a theme so that these new panels can be edited via the Zone Panel Editor.

For example besides Top, Bottom, Left and Right Panels I would like to define something like "Center Top, Center Bottom and/or Left Top, Right Top etc.

To be more specific I want to create  a new theme that is basically broke into 2 halves (ie Left 60% Right 40% - Not counting Top and bottom full width sections) then I wish to bury the normal Left and Right Panels into the right hand section but I wish to add a new Top and new Bottom Panel section to the right half. I still would keep the normal Top and Bottom Panels designed to run full width.  But I want to make it so users can add blocks etc to the Right half new Top and Bottoms panels via a panel editor.

Where should I begin looking to implement these features? (if there is not already an easy way to do this)

EDIT: it appears temcode.php is the answer to this question

Question seems I may not get a "Zone Editor" option without some code change likely but the workaround mentioned below seems to look good enough for me now.


Last edit: by Duck
Back to the top
 
Posted
Rating:
#99112
Avatar

Community saint

My initial poking around makes me think I could just make new comcode pages and have my theme use them like panels. I may not be able to edit them in a panel editor as such (I don't know yet) but I am guessing this would at least work as a workaround. I am curious if the prefix of panel_ to the code name would make it appear as an editable panel but if not at the very least the (psuedo panels) pages could be edited via the comcode pages editor.

EDIT: Yes defining a comcode page works and I prefixed with panel_ and it shows in theme fine so far but with a link to edit comcode page only not a link to edit via zone editor.

This should work ok I imagine.


Last edit: by Duck
Back to the top
 
Posted
Rating:
#99113
Avatar

Community saint

Ok I stand corrected. I didn't realize I was testing off an earlier release of ocP. While testing stuff in 9.0.8 it works differently and there are no edit links on the page for admins. You can still edit by going into the comcode page editor but this isn't very intuitive for new users.
Back to the top
 
Posted
Rating:
#99114
Avatar

If you look in GLOBAL_HTML_WRAP you'll see how the default panels are put there, nothing is hard-coded – except, that the zone editor can only handle the left/right ones as that editing interface is separately coded.

It's pretty similar to what you did, just LOAD_PANEL rather than LOAD_PAGE. I'm not sure how this will put in an editing link, but the assumption is that who did it will know what they did and find the page for editing easily enough. If bundled into a theme probably the theme would need some instructions on that.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#99116
Avatar

Community saint

Yeah that is what I did initilial test was use the load panel in global html wrap.  I tested a couple added panels to default theme and it displays them fine. I think my earlier test was on a v8 system and that automatically threw in the links to edit via comcode page editor which was kinda cool. v9 doesn't do this.

Are panels defined by zone only or are they also defined by page? I mean can I have one set of blocks in the start page (left panel lets say) of site zone and then a different set of blocks on another page of the same site zone?

 I know this could effectively be achied with some tempcode programming but I mean just by default.
Back to the top
 
Posted
Rating:
#99117
Avatar

The default is just what GLOBAL_HTML_WRAP says, so the default is Tempcode programming :).

It may be COMCODE_PAGE_SCREEN only shows the editing link for panel_left/panel_right, due to the zone editor not supporting other ones.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#99118
Avatar

Community saint

I think I asked the question wrong? This has nothing to do with adding new panels I am talking the panels already found in the Zone Editor (Left and Right) when I edit them in Zone editor can I have different content in the same zone but different pages(my tests suggest not but just wondering n case my system wasn't working correctly) or is it only I can change the content when in different zones?
Back to the top
 
Posted
Rating:
#99121
Avatar

Yeah, I was answering slightly differently probably ;). Sometimes I code the global template to load up alternate panels, based on context.

An alternative, more in line with your thought process here, is putting some Tempcode inside the panel…

Code

{+START,IF,{$EQ,{$PAGE},news,galleries}}
News and galleries will see this
{+END}
{+START,IF,{$NEQ,{$PAGE},news,galleries}}
Everything else will see this
{+END}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: