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.


[RESOLVED] - Calling all Coders - Help needed ... !!

Login / Search

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

Community saint

Scenario: 8.1.1 installation of ocP. User wants 3-column display as 'standard', but would like one, or two, or three, or more pages to selectively display in 2-column. In other words, drop the right_panel for these pages.

I first used the $MATCH_KEY_MATCH trick around 2006, many versions ago, and tried to insert the edit in GLOBAL.tpl. It worked. Too well. It zapped the right_panel for ALL the pages. Bummer!


{$SET,right_width,{$?,{$IS_EMPTY,{$TRIM,{$GET,panel_right}}}
,{$?,{$GET,helper_panel},{$?,{$HIDE_HELP_PANEL},26px,275px},0
},{$PANEL_WIDTH_SPACED'}}}
   {$SET,middle_width,auto}


was changed to:


{$SET,right_width,{$?,{{$AND,{$MATCH_KEY_MATCH,welcome:membe
rs:type=view}}
,{$IS_EMPTY,{$TRIM,{$GET,panel_right}}},{$?,{$G
ET,helper_panel},{$?,{$HIDE_HELP_PANEL},26px,275px},0},{$PANE
L_WIDTH_SPACED'}}}
   {$SET,middle_width,auto}


to try to display the member profile page (with the pretty new tabs I built - aw! c'mon!), and it sure as hell worked, but I don't think my syntax is specific enough.

Anybody got the smarts to dig me out of this hole?


Last edit: by Fletch

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobS)  
Rating:
#86685
Avatar

Community saint

I haven't explored tempcode yet sorry can't help but this sounds like a job Temp1024 could probably handle?
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobS)  
Rating:
#86688
Avatar

Community saint

Hi Fletch!

Did you say "MATCH_KEY_MATCH,welcome:members:type=view" Worked. As right now?

I remember that Chris one day helped me out on one of my delving into tempcode mentioning that "welcome" being the beginning of that zone does not have to be stated."

I would deduct from this that if it is stated than that is why it works "so well" removing panel_right on all pages of the Welcome zone. Try this instead:  "MATCH_KEY_MATCH,:members:type=view".

I maybe completely off here, but it is probably worth a try.;)

Jean
Back to the top
 
Posted
Rating:
#86696
Avatar

Community saint

Jean said

Try this instead:  "MATCH_KEY_MATCH,:members:type=view".

Thanks, Jean. Tried dropping 'welcome' (the zone). Didn't work, but gave me a bit more insight into TEMPCODE.

I think I was also missing (bits in red), and I am almost convinced that there should be an ID in there, but I am at a loss as to how to give a core page an ID …


{$SET,right_width,{$?,{$OR,{$AND,$MATCH_KEY_MATCH,welcome:me
mbers:type=view}},{$IS_EMPTY,{$TRIM,{$GET,panel_right}}},{$?,
{$GET,helper_panel},{$?,{$HIDE_HELP_PANEL},26px,275px},0},{$P
ANEL_WIDTH_SPACED'}}}}
   {$SET,middle_width,auto}


Still no closer to resolution, but it certainly keeps me out of the bars and off the streets!

cheers


Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#86701
Avatar

Community saint

Fletch said

Still no closer to resolution, but it certainly keeps me out of the bars and off the streets!
You need a portable or tablet so you can work on this while at the bar. It's amazing the way alcohol liberates the mind when working on impossible problems.  :)

Bob

Back to the top
 
Posted
Rating:
#86702
Avatar

Community saint

:o

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#86704
Avatar

Community saint

:party: Bob


http://digiflash.nl Photo community  (dutch)
Back to the top
 
Posted
Rating:
#86722
Avatar

Without reading all the posts here, I'll quickly see if I can weigh in.

In recent versions we've made Tempcode very slightly easier, in that the symbols don't need so much chaining to do 'OR' stuff – it's built into 'EQ' to automatically 'OR' against any of the parameters passed to it.

With that in mind I'll try and record a quick Jing video of my thought process here.


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
Item has a rating of 5 (Liked by BobSLiked by JeanLiked by Duck)  
Rating:
#86724
Avatar

Not sure how clear this is. I didn't make any effort to script this out, or slow down my normally rushed talking (the Jing 5 minute limit doesn't help ;)), but…

2012-06-07_2230 - ocProducts's library
2012-06-07_2236 - ocProducts's library


Code

{$SET,helper_panel_width,{$?,{$HIDE_HELP_PANEL},26px,275px}}
{$SET,panel_width_if_no_panel,{$?,{$GET,helper_panel},{$GET,helper_panel_width},0}}
{$SET,has_no_panel,{$IS_EMPTY,{$TRIM,{$GET,panel_right}}}}
{$SET,uses_special_width,{$MATCH_KEY_MATCH,site:members,site:downloads,:join}}
{$SET,special_width,150px}
{$SET,panel_width_if_has_panel,{$?,{$GET,uses_special_width},{$GET,special_width},{$PANEL_WIDTH_SPACED'}}}
{$SET,right_width,{$?,{$GET,has_no_panel},{$GET,panel_width_if_no_panel},{$GET,panel_width_if_has_panel}}}

I haven't tested this. This just what I ended up with after going through my thought process.


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

Would appreciate if someone copied this (tidied up a bit) onto community docs :).


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

Community saint

Oh, this is so beautiful!

I've watched the videos and find the process much clearer now. I guess that if Fletch wants no panel_right on some of those pages, he could simply give it a width of 0px if he were to keep the code as is.

I've got to go for dinner now, but I want to try this formula later on and see to it between Fletch and I that it is posted on the Community docs.

Thank you Chris for your time.
Back to the top
 
Posted
Rating:
#86731
Avatar

Community saint

ROTFLMAO!

I actually followed ALL the reasoning, and I am so pumped up that I am going to attempt this 'fix' on the site I am trying to work on.

If I am successful, I will accede to your request and add it to the community docs with links to the two Jing vids as explanatory information.

For the moment … thanks

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobSLiked by Jean)  
Rating:
#86737
Avatar

Well-settled

This is actually for my site that Fletch is helping me out a lot on in building the theme for (Really Top Bloke Fletch :thumbs: ).

I have just watched both of them tutorials, and have got to say WOW!!, Chris you made something (what I would term as a non coder) what looked so complex and turned it into something what looked like a doddle to accomplish ha, amazing.

Now all you need to do is drop all us not so skilled users a tick config box on each page we want this set, haha Just Joking! :thumbs:
   
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobSLiked by Jean)  
Rating:
#86741
Avatar

Community saint

kenno said

This is actually for my site that Fletch is helping me out a lot on in building the theme for (Really Top Bloke Fletch :thumbs: ).

Hey, I liked that comment!

You site has been sorted, and I am here to report to Chris that the 'fix' was worth its weight in GOLD. I needed to make a couple of minor adjustments to reflect the page(s) I needed for this one, and it all works like MAGIC!

thanks    thanks    thanks




P.S. Reminder to self - get it into the 'Community Docs'

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobS)  
Rating:
#86745
Avatar

Community saint

Yes, it's like "MAGIC"!:)

It is perfect and when I changed "SET,special_width,0" it gave me a 2 panel instead of 3 (no panel_right).

Thanks to Fletch for bringing this up and to Chris for giving us is precious time.

Most appreciative!
:thumbs:
Jean
Back to the top
 
Posted
Rating:
#86746
Avatar

Community saint

I haven't really looked at the Tempcode side of things yet but seeing this thread and the explanations Chris offered has me excited about jumping into it as that is one clear definition of how to do things!
Back to the top
 
Posted
Rating:
#86748
Avatar

Community saint

Chris-

Thanks for the great videos. Still a bit above my head but the new way is much more approachable by mere mortals.

It is clear to me that you are one of the most conscientious and open-minded developers I have known, always willing to consider trade-offs and willing to explain.

Kudos!!

Bob
Back to the top
 
Posted
Item has a rating of 5 (Liked by BobSLiked by Jean)  
Rating:
#86751
Avatar

Community saint

Jean said

  • … and when I changed "SET,special_width,0" it gave me a 2 panel instead of 3 (no panel_right).
  • Thanks to Fletch for bringing this up and to Chris for giving us is precious time.

Yeah, that 0 parameter was something I overlooked the first time, but I got there in the end!

No thanks to me for bringing it up. I remembered that 'back in the day', can't remember the version, there were several pages I wanted displayed in a similar fashion, and Chris and Philip (I think it was Philip) spent hours on my site working this little bit of magic. So I thought it might be as well to resurrect it for those that were late to the party. And thanks to Chris, this time it has been fully explained and should come in pretty handy for several users - even if they don't acknowledge it.

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#86762
Avatar

Community saint

Duck said

I haven't explored tempcode yet sorry can't help but this sounds like a job Temp1024 could probably handle?
I had a quick look at it and was getting utterly confused O_o . I new I had to break it down in some fashion before I could start making some sense of it. The only think I wasn't quite sure about was the $MATCH_KEY_MATCH as I very rarely even look at it, let alone use it.

In any case it was late, my brain was shutting down. So I left it.

I was so relieved when in the Jing Chris said "Complex lump of code that even I don't understand". It meant I wasn't totally loosing my code reading abilities.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#86763
Avatar

Community saint

I remember back in my coding days. We had a couple of programmers we would turn to when we needed super-efficient code. The problem was that supporting that code was a nightmare as programmers later had to decipher the code. Usually, it took an explanation from the author.

I'm glad that Chris is looking at the trade-off between efficiency and approachability. I think that the example in the videos, if adopted as standard, will make it much easier for people to get more creative with designs which is a big win for ocPortal.

Bob
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Expand