Jump to content

Any of you here created conditional sidebars?


Zahari M.
 Share

Recommended Posts

Hi Guys

Slowly getting into ProcessWire :rolleyes:  Bit by bit the sites coming together.

So, Im going for a 3 column layout. I'm just wondering what strategies you guys are using to display your sidebars.

I'd like to create conditional sidebars depending on what section of the site the visitors are in and am just wondering if any of you have done this and how you went about it....

Since Im using 2 sidebars, I was thinking of using 2 parent pages and various child pages to represent each desired sidebar.

But before going further with this... just wondered if anyone has gone down this road before!

Cheers n thanks for reading...

Link to comment
Share on other sites

Yep, see delegate-profile. (example site using widgets: ddb.nu)

It uses "Widgets" for the sidebar (pages). Created widgets (pages in the "folder" widgets) will be rendered on the $page.

It's a very basic profile, with 3 pages or so, and not many fields/templates.

Every widget template has at least:

- a template select ( Widget will be rendered on pages Pages using the selected template, multiple templates can be selected  )

- a position to render (left column or right column)

Rendering Widget:

- On every $page you can disable the rendering of a widget.

- If there are no widgets to render, the column will not be rendered. The width of the column is given back to the content column.

  Example: | 3columns | 5 columns | 4columns | <- normal

  Example: | 8 columns| 4columns | <- no left widgets to render

Column widths:

- You can set the column width with Soma's range Slider. (located in: /Widgets/) It's based on Gumbies 12 columns design.

  ( Zurb Foundation has almost the same class names )

It's using a delegate Approach.

Important:

- You need to install: FieldtypeRangeSlider and FieldtypeTemplates. (tnx Soma and Hani):

Recommended install:

-TextformatterGumbyList

 

Beware, documentation is <blink>really outdated</blink> (shame on me). But the profile is 2 weeks old or something. 

It uses the gumby CSS framework. 

Cheers

Link to comment
Share on other sites

Hi Martijn

Thanks for your reply earlier. The site you pointed me to looks really nice. And that gumby framework looks outstanding... very nice looking indeed!

Ok.... so I have tried to install that delegate profile in MAMP but I have come across an error that is preventing the front end from displaying... admin side is fine... just the front end has a white screen...

Error:     Call to a member function render() on a non-object (line 44 of
/Applications/MAMP/htdocs/delegate.dev/site/templates/includes/view.inc)

Looking at line 44, we have this: <?=$modules->get('MarkupCSScompress')->render()?>

Any ideas what we need to do to fix this Martijn?

Thanks!

Link to comment
Share on other sites

Aha, install MarkupCSScompress, will fix it. (is located in /site/modules.)

An other option:

delete the lines "<?=$modules->get('MarkupCSScompress')->render()?>"

And copy/paste on that place the code below.

foreach ($config->styles as $file) echo "<link rel='stylesheet' href='{$file}'>\n\t";

Link to comment
Share on other sites

Hi Martijn

That fixed it! Thanks for that.

Just as a note... on the front end... if we press the edit button in the top right corner, we get a 404 for the main content.

But Im thrilled that I downloaded this site profile.

I learnt two things from you Martijn.

One is that the way you split the admin area 60 / 40 and used fieldsets. Very nice.

The other is how you used that range slider.  Thats fabulous! 

I'm very glad I downloaded this. Thanks for all the work here Martijn!

Now... to go look at the widgets... :rolleyes:

Link to comment
Share on other sites

404 on admin link? Sounds to me you changed the address of the admin.

( or there's some nasty proxy/browser cache going on )

ps, this profile is more a boiler plate (starting point) it's not much work to switch gumby for zurbs foundation. With a little bit effort you can make it work with twitter bootstrap. (It originates from a custom made gridsystem)

Link to comment
Share on other sites

Hi Martijn

Your diagnosis was spot on! It was due to me changing the admin url. You know PW very well! I reinstalled everything and edited view.inc as before and now the edit button on the front end works. Yay!

By the way.... I tried to look for MarkupCSScompress in sites/modules but it is not included... or at least I can't find it!

So I went to the ProcessWire modules page to look for it and download it. I'll try it out later on once Ive worked on those sidebars.

Anyways... Thanks again Martijn!

Cheers

Link to comment
Share on other sites

Hey Martijn

Just wanna say that your delegate site profile has been incredibly helpful.

Had a chance to take a better look at it just now and there are some excellent concepts there! Thank you so much for this site profile.

As I understand so little about ProcessWire, I was looking for a way to establish a sort of bi-directional relationship between an idividual page and a collection of individual sidebars.

It's both interesting and great that we are looking at this issue in very similar ways. I did have a slightly different take on how i wanted do a few things.... but I just didnt know where to start due to lack of knowledge of the ProcessWire system.

Thanks to your very clever use of php page select code and utilization of the template naming options, I can now see how to create these "bi-directional" relationships.

So, thanks again mate!

Still a few other basic things that Im working on to get my first site working properly. So hopefully I can start the sidebar system in a couple of weeks. Might have a few questions for you then if Im stuck... hee hee :D

Cheers!

  • Like 1
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...