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.


Understanding Panels in templates.

Login / Search

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

Community saint

Particularily the dynamics of the helper panel.

Sorry I need a little help trying to understand how panels work and while I think I have a good grasp of the tempcode involved in panel loading decisions one part I am not sure about and with a little poking around have come to a conclusion which I am not sure is correct or not.

Basically I would like to know if: Whenever a help panel is to be displayed does the system usually turn off the right and left panels? (The few example pages I looked at on a test install suggest this)

The following tempcode suggest to me that if a right panel exists the help panel should not be displayed which can only mean the right panel is not sent to the template if a helper panel is suggested.

Here is code from global_html_wrap.tpl that covers this section and my explanation of how I understand it

Code

            {$,Deciding whether/how to show the right panel requires some complex logic}
            {$SET,HELPER_PANEL_TUTORIAL,{$?,{$HAS_PRIVILEGE,see_software_docs},{$HELPER_PANEL_TUTORIAL}}}
            {$SET,helper_panel,{$OR,{$IS_NON_EMPTY,{$GET,HELPER_PANEL_TUTORIAL}},{$IS_NON_EMPTY,{$HELPER_PANEL_PIC}},{$IS_NON_EMPTY,{$HELPER_PANEL_HTML}},{$IS_NON_EMPTY,{$HELPER_PANEL_TEXT}}}}
            {+START,IF,{$OR,{$GET,helper_panel},{$IS_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}}}
               <div id="panel_right" class="global_side_panel{+START,IF_EMPTY,{$TRIM,{$LOAD_PANEL,right}}} helper_panel{+START,IF,{$HIDE_HELP_PANEL}} helper_panel_hidden{+END}{+END}" role="complementary" itemscope="itemscope" itemtype="http://schema.org/WPSideBar">
               {+START,IF_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}
                     {$LOAD_PANEL,right}
                  {+END}

                  {+START,IF_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}
                     {+START,INCLUDE,GLOBAL_HELPER_PANEL}{+END}
                  {+END}
               </div>
            {+END}

            First we set a HELP_PANEL_TUTORIAL if the user has the privillage to see it.
            Next we set a tempcode variable if The above is not empty or any of the other 3 Help panel items are not emtpy
            Then if either the helper panel or the right panel are set we start opening a div called "panel_right" and add to it class declarations based on (if panel right is empty) whether helper_panel is hidden or not.
            
            HERE COMES THE  PART THAT CONFUSES ME:
            
            Next if Panel right is empty we display the helper panel if it isn't we display the right panel. This to me suggests that anytime a helper panel is to be included (from the php side of things not templating) then the right side will always be empty? I am guessing that so is the left side (panel left empty) at that point?
            
            
            The reason I ask is the attached image is a layout for a theme (using the responsive css grid system) I wish to make and I have to determine some logic based on whether helper panels and/or left panels and/or right panels are to be displayed and I believe I can come up with that logic if I understand what is going to be passed the template in certain situations: That being primarily if helper panel is to be displayed would that always mean left and right panels will be empty and if they aren't should they override the helper panel completely or show it above or below them accordingly?



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

It's not that it won't display the right panel if there's a helper panel. It's the opposite: it won't display the helper panel if there's a right panel.

You're much better off just forgetting about the helper panel entirely. Rip out the whole

Code

            {$,Deciding whether/how to show the right panel requires some complex logic}
            {$SET,HELPER_PANEL_TUTORIAL,{$?,{$HAS_PRIVILEGE,see_software_docs},{$HELPER_PANEL_TUTORIAL}}}
            {$SET,helper_panel,{$OR,{$IS_NON_EMPTY,{$GET,HELPER_PANEL_TUTORIAL}},{$IS_NON_EMPTY,{$HELPER_PANEL_PIC}},{$IS_NON_EMPTY,{$HELPER_PANEL_HTML}},{$IS_NON_EMPTY,{$HELPER_PANEL_TEXT}}}}
            {+START,IF,{$OR,{$GET,helper_panel},{$IS_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}}}
               <div id="panel_right" class="global_side_panel{+START,IF_EMPTY,{$TRIM,{$LOAD_PANEL,right}}} helper_panel{+START,IF,{$HIDE_HELP_PANEL}} helper_panel_hidden{+END}{+END}" role="complementary" itemscope="itemscope" itemtype="http://schema.org/WPSideBar">
                  {+START,IF_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}
                     {$LOAD_PANEL,right}
                  {+END}

                  {+START,IF_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}
                     {+START,INCLUDE,GLOBAL_HELPER_PANEL}{+END}
                  {+END}
               </div>
            {+END}
block and then re-add one that is just:

Code

            {+START,IF_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}
               <div id="panel_right" class="global_side_panel" role="complementary" itemscope="itemscope" itemtype="http://schema.org/WPSideBar">
                  <div class="stuck_nav">{$LOAD_PANEL,right}</div>
               </div>
            {+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
 
Posted
Rating:
#99287
Avatar

Community saint

Chris said

It's not that it won't display the right panel if there's a helper panel. It's the opposite: it won't display the helper panel if there's a right panel.

Well that is what the logic in the template tells me but my experience has been to see the right panels gone whenever I see the helper panel? I haven't many places to test the theory but I went to CEDI and in there I had right panels but when I choose to edit anything right and left panels disappear and I have a helper panel so that made me think the template logic is being replaced by serverside php logic and Panel_right and Panel_left must be empty when there is a helper panel because the template logic says if right exist you wont see helper.  But any page I could find on my test site that has a helper panel doesn't have a right or left panel. Some pages stack the right panel below the left panel though but i figure thats just some different CSS being called up for that page?

I could ignore helper panel but I wanted to share this theme back to the community and I thought maybe I should leave it in for those who might benefit from it.

I have some complex logic to come up with or without it in but with it in is most complex I suppose.

I have to test if helper, right and left are all set and act accordingly. My right and lefts (original ocPortal right and left panels) are suppose to act as  single wide columns (nested in a double wide column) that if either one is empty or both are full and/or if the helper column is called for.

My thought is to set a tempcode var called "panel_needed" to a string of "None", "Left", "Right", "Helper", "Both" but that only works if helper replaces Right and Left when present otherwise it gets more complex.

Perhaps I will Use helper panel as an if for my new Panel_Top_Right spot and if present replace top right it or add it just above or do as the template presently suggest (if top right exists ignore helper)? But even with the helper placement figured out it still adds more logic to figure out.
Back to the top
 
Posted
Rating:
#99289
Avatar

Community saint

BTW is there still a reset theme addon for ocPortal v9 (I know there was one for earlier versions but I didn't see it in the v9 addons)?
Back to the top
 
Posted
Rating:
#99290
Avatar

It may be because you're switching to the cms zone when editing Wiki+ pages, and thus the panels you thought were there are now not.

There's no reset theme for v9, no. Maintaining those was always a bit much work, but actually it's not too bad to just cull styling from global.css.


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:
#99999
Avatar

Community saint

Because this still basically pertains to this topic I am continueing in this thread.

Ok so I have this in (global_html_wrap) near top (well by body tag for now)

Code

{$INIT,show_panels,0}
<body>
{+START,IF,{$OR,{$IS_NON_EMPTY,{$TRIM,{$LOAD_PANEL,left}}},{$IS_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}}}
{$SET,show_panels,1}
{+END}

Then further down supply this logic:

Code

         <div class="section group">
            <div {+START,IF,{$GET,show_panels}}class="col span_4_of_6"{+END}>
               <article class="global_middle">
               {$,Breadcrumbs}
               {+START,IF,{$IN_STR,{$BREADCRUMBS},<a}}{+START,IF,{$SHOW_HEADER}}
                  <nav class="global_breadcrumbs breadcrumbs" itemprop="breadcrumb" role="navigation">
                     <img class="breadcrumbs_img" src="{$IMG*,breadcrumbs}" title="{!YOU_ARE_HERE}" alt="{!YOU_ARE_HERE}" />
                     {$BREADCRUMBS}
                  </nav>
               {+END}{+END}

               {$,Associated with the SKIP_NAVIGATION link defined further up}
               <a id="maincontent"></a>

               {$,The main site, whatever 'page' is being loaded}
               {MIDDLE}
               </article>
            </div>
            {+START,IF,{$GET,show_panels}}
            <div class="col span_2_of_6">
                     {+START,IF_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right_top}}}
                        {$LOAD_PANEL,right_top}
                     {+END}
               <div class="section group">
                  <div class="col span_1_of_2">
                     {+START,IF_NON_EMPTY,{$TRIM,{$LOAD_PANEL,left}}}
                        {$LOAD_PANEL,left}
                     {+END}
                  </div>
                  <div class="col span_1_of_2">
                     {+START,IF_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right}}}
                        {$LOAD_PANEL,right}
                     {+END}
                  </div>
               </div>
                  {+START,IF_NON_EMPTY,{$TRIM,{$LOAD_PANEL,right_bottom}}}
                     {$LOAD_PANEL,right_bottom}
                  {+END}
            </div>
            {+END}
         </div>

Now if I visit Site zone where I have panels set it is displaying fine but when I visit forums (and adminzone for that matter) It is reserving space for the coumns but nothing is displaying in that space. If I look in comcode pages in adminzone it says I have a Forum:left_panel page and that has some block content set so I figure that is why the space is reserved but I don't understand why the content is not displayed.


Back to the top
 
Posted
Rating:
#100000
Avatar

What happens if you change $INIT to $SET?


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:
#100003
Avatar

Community saint

Wow that seemed to sort it out.

Well at least no the space isn't reserved for Forums and Adminzone now. However I am curious as to how or why the comcode page for left_panel is not showing up in the forum?

It stilll exists in the list of comcode pages after changing init to set but it no longer reserves space (which is good) except if there is set a panel_left for forums zone should it now be spitting out something?
Back to the top
 
Posted
Rating:
#100004
Avatar

Community saint

I don't know if this may be pertinent butI am viewing the theme via theme preview and a keep_theme=rep2 in the url
Back to the top
 
Posted
Rating:
#100005
Avatar

This is a strange aspect of Tempcode. It actually evaluates all SET's in a pre-process sweep without checking the IFs, before going through and doing it properly. Pre-processing is needed to make sure any implied resources (e.g. CSS sheets) get loaded up, as it can't load those once the output stream has started for real. For complex reasons it doesn't reset the data inbetween. Changing $INIT to $SET made it do a hard-reset on the main run.


Do you still have the transparent redirect from forum:panel_left? (the default one) Admin Zone> Structure>Redirects
It probably is obscuring the real panel you have set.



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:
#100006
Avatar

Community saint

I just checked and there are no re-directs relating to Panle_Left the only ones relating to forums are for Panel_Top and Bottom and RULES
Back to the top
 
Posted
Rating:
#100007
Avatar

Duck said

I don't know if this may be pertinent butI am viewing the theme via theme preview and a keep_theme=rep2 in the url

The iframe in the theme wizard preview is opened with &wide=1 (or is it &keep_wide=1) to try and make it fit more neatly into there. Perhaps this is why. The wide signal disables panels.


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:
#100008
Avatar

Community saint

Ok so I set the theme active on all zones and no the forum left panel still does not show.

Here are 3 pics to see settings of panel in zone panel editor and a pic of the forum itself to see it is not showing

NOTE I am using 9.0.8 on my local machine for this so I don't know if there were any bug patches that may pertain to this but I don't remember seeing any?

Back to the top
 
Posted
Rating:
#100009
Avatar

Oh of course, the forum zone will be set to wide, or optional based on member settings. Check the zone settings.


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:
#100011
Avatar

Community saint

Ok yeah it had respect member settings set for theme in zone and under my account was checkmarked hide the panels if not needed.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: