Jump to content


getSidebar


  • You cannot reply to this topic
33 replies to this topic

#21 lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 605 posts
  • Gender:Male

Posted 16 March 2007 - 07:17 AM

G'day,

On the web site where I've been using getSidebar there was an interesting flow on effect.

Having all of those unpublished documents about everywhere caused ListSiteMap to start generating empty
<ul></ul>
statements in some cases. Which means the sitemap page didn't validate.

The solution for me was to change ListSiteMap to use the Etomite function getActiveChildren instead of getAllChildren. (I never did understand why it wasn't coded that way in the first place. But someone went to a lot of trouble to have it that way, so there must be a reason.)

Best Regards, Lloyd Borrett.

#22 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 16 March 2007 - 12:33 PM

Lloyd,
That works for me- thanks for the updates!
Also on ListSiteMap... that issue came up when we built this getSidebar, I think showing only active children is the right way to go.

#23 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 16 March 2007 - 02:07 PM

While the same overall results were possible with the original code, as is evident by my demo, the added logic does help in generating better markup... I had intended on improving the wrapper portion of the code but other things came up that were of greater urgency... Good tweaks, Lloyd...

#24 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 18 March 2008 - 10:36 PM

Is it possible to check a user's permissions before displaying the document called by getSidebar?

I see that getDocContent does simple permissions, but that's not what I need.

I want to include page content based on the level of the users logged in. for example, a user in california sees cali-related content, not florida's, in the same page. It seems like the permissions are checked for the document calling the unpublished pages with getSidebar, not at the unpublished page level.

Thanks ;)

#25 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 18 March 2008 - 11:53 PM

View Postdarren, on Mar 18 2008, 06:36 PM, said:

Is it possible to check a user's permissions before displaying the document called by getSidebar?

I see that getDocContent does simple permissions, but that's not what I need.

I want to include page content based on the level of the users logged in. for example, a user in california sees cali-related content, not florida's, in the same page. It seems like the permissions are checked for the document calling the unpublished pages with getSidebar, not at the unpublished page level.

I guess it depends on what level of permissions you want to check... Anything is possible with a little tweaking... Permissions checking could be put into the snippet, whether for simple authentication (login) checking, or full permisions complete with role checking...

#26 bwoodsdesign

    Likes Etomite Forums!

  • Member
  • PipPip
  • 236 posts

Posted 05 March 2009 - 08:08 PM

I have a sort of complicated template that was designed by a colleague and converted into working xhtml/css by me, and was wondering if I could use the getsidebar snippet for it...

You can see it at this site.

As you can see by the example (not placed into Etomite yet, this is a full working HTML hard coded site), there are 2 navigation areas, the primary being across the top, horizontally, and the secondary being on the left side, which changes based on which page is being visited...and further, changes the selected value/color also based on which sub-page is being visited.

Also, as you can see from the site, there is a side bar on the right which will show advertisement banners. I think I will use ShowDoc for this within the template, to call to a doc which I set up the ads in... but is there a better solution?

Also wondering if anyone has any suggestions for the Resources > Start a Business page...these are also advertisements which, below the heading graphic on this page, are listed in a fashion which we'd like to be as "anchor tags" to jump to each of those ads.

I'm looking for a way to make it so that the client can add ads for each of those sections (each of the Resources pages--look in the sidebar--will have a different set of ad boxes--wrapped in divs) So I'm wondering how I could pull this off, without me having to do too much mucking around with multiple templates? ;)

Edited to make more sense :P

Edited by bwoodsdesign, 05 March 2009 - 08:11 PM.


#27 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 05 March 2009 - 08:34 PM

I'm sure getSideBar would be able to do a lot of it, but that's not really my area. I prefer to use a "contoller" snippet that goes in the template for multiple displays. The controller snippet uses runSnippet() to populate the various implementations of it (from a single template and mutliple snippets) in a variety of contexts. The context can be the document, it's parent, children, referring pages or post and get variables. This method can be used to control css sheets that load, documents that load below the [*content*] and a variety of sideBar or even navigations. But I'm guessing that the hardest part for you, unfortunately, would be the snippet part. Perhaps someone knows of out of the box snippet options to use. If you are keen to go this total control freak way, then I'm happy to post an example of a controller snippet and snippet call that would put you on this track.

#28 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 05 March 2009 - 09:39 PM

Well, bwoodsdesign, there is always a way to accomplish a task using Etomite - it just depends on how elegantly that task can be handled... The getSidebar snippet can work with multiple pages, rendering a different sidebar for each page, but requires a bit of forethought about how the documents and associated sidebars will be maintained... Adding anchors to each sidebar item is no probelm as long as the person entering the information knows the proper steps based on how you want that information to be pulled and rendered...

Alright, it all sounds like Greek at this point, I'm sure... Let me break it down a bit and ask a few questions... Stick with me because my mind is still mulling around a bunch of Javascript/Server timestamp discrepancies from todays programming stint...

Do you want different sidebar information based on which section a visitor is viewing...??? If so, that can be done...

As far as the anchors are concerned, do you mean anchors or links...??? From a sidebar I'd be inclined to assume that what you mean is links...

Because I find getSidebar to be such a useful snippet, thanks to cathode's ideas and my running with the concept, there is probably even more potential for flexibility than has been imagined yet... Feel free to PM me if you like and perhaps we can hash some ideas to see how to best serve your clients needs... Once we get things figured out we can share the results here... Or we can continue here if you like...

<<< Brain feels like it's turned to baby poop... :blink: >>>

#29 bwoodsdesign

    Likes Etomite Forums!

  • Member
  • PipPip
  • 236 posts

Posted 24 March 2009 - 07:45 PM

Hi Lloyd

I'm looking at the getsidebar.php file you revised and am a bit confused about usage. I had a conversation going with Ralph about this, and I'm just posting the same query here, that I sent to him recently.

In the website I'm working on for a client using Etomite (http://www.connectio...m/about-us.html), the sidebars (seen on left hand side of pages) are secondary navigation (primarily echoing the horizontal navigation) except that the sidebar contents are limited to whatever section your are currently browsing. I.e., if you are on the About Us section, you would see About Us > Go-To-Gal, Teresa, Samantha - in the sidebar for that page.

Those are in a div called leftnav, then further a div called bg-left-nav controls the look, background color, and border of that nav section. Then each of the items contained is in a UL, and the list items are further styled by different classes, depending on which page you are looking at. The default "OFF" state of a link in that unordered list is the light blue, the mouseover state is a darker shade of that blue, and the selected state (active page) is the green color. You'll notice on the link above, how each sidebar list item state changes, depending what page within that section you are visiting. Some of the pages have no child documents, thus the sidebar contains just one item, which isn't really a link, but needs to have a # linked on it to be styled the way it is via CSS.

What I need to do is be able to pull in the respective sidebar for each page (which I plan to set up as Parent folder docs in Etomite, and each sub-item in the sidebar as child docs.

What I'm confused about, is how to utilize getsidebar snippet to be able to style the listed items within the div / ul and still have the correct state as shown in the page I've created, without having to create multiple (and seemingly endless) templates.

Hopefully this makes some sense. Any strategy advice you might have on how I could do this would be appreciated!

Edited by bwoodsdesign, 24 March 2009 - 07:47 PM.


#30 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 26 March 2009 - 05:50 PM

Styling something based on what page it on, what section it's in, or whatever is simple... but you do need to write the styles for it.

Here's how I'd do it. On your nav div, set a class to the alias. Example:
<div id="nav" class="[*alias*]">
...
</div>

Or, if you don't want the class to be page-based, you can use a snippet that grabs the alias of the root-level document (section.) Example:
<div id="nav" class="[[getSection]]">
...
</div>

Then in the css, you set style modifiers based on aliases: Here's an example style class, where "about-us" matches the alias:

#nav.about-us li a {
	 background-color:red;
}

You'd have to do it for each class.

I realize that's not an exact example for your situation, but you should be able to run with the concept. This is not a getSidebar problem, but a CSS problem.

Edited by cathode, 26 March 2009 - 05:52 PM.


#31 bwoodsdesign

    Likes Etomite Forums!

  • Member
  • PipPip
  • 236 posts

Posted 26 March 2009 - 06:37 PM

Hi Ian

Thanks for the response. I think I got the overall points you are suggesting, I will have to figure this out. Problem is, I didn't write the CSS for this page I'm wanting to use getsidebar on (someone else did)...so it will be difficult at best, for me to pull this off.

The time I've spent researching getsidebar as an option and all this back and forth forum stuff might have been better spent just doing multiple templates or alias chunks for page X, page Y and so forth. I am supposed to have this site done like, last week!

At this rate I would have to just dive into the template-monkeying and do this finagling later, unless I can find someone willing to this part for a fee.

Thanks again :)

edited to clarify something

Edited by bwoodsdesign, 26 March 2009 - 06:38 PM.


#32 cathode

    Loves Etomite Forums!

  • Staff
  • 648 posts
  • Gender:Male

Posted 27 March 2009 - 03:18 PM

View Postbwoodsdesign, on Mar 26 2009, 02:37 PM, said:

Hi Ian

Thanks for the response. I think I got the overall points you are suggesting, I will have to figure this out. Problem is, I didn't write the CSS for this page I'm wanting to use getsidebar on (someone else did)...so it will be difficult at best, for me to pull this off.

The time I've spent researching getsidebar as an option and all this back and forth forum stuff might have been better spent just doing multiple templates or alias chunks for page X, page Y and so forth. I am supposed to have this site done like, last week!

At this rate I would have to just dive into the template-monkeying and do this finagling later, unless I can find someone willing to this part for a fee.

Thanks again :)

edited to clarify something

I could write this in my sleep - I'll PM you.

#33 Vineesh

    Etomite Forum Newbie

  • Member
  • 33 posts

Posted 28 March 2009 - 01:58 AM

I need a little help with the getsidebar snippet. Right now getsidebar(the default template's main.css in fact) is styled to display the sidebanners on the left side under the listmenu. I want to try moving the sidebanners to the right, while keeping the nav list menu on the left itself. It myt be something simple with a few modifications on the Stylesheet

But i dont wanna risk playing with the layout of our style sheet as i have to bring my production site up without fail today.

Thanks in advance for the help..
(I thank one n all for all the help extended so far with etomite.)

Best regards
Vineesh

Edited by Vineesh, 28 March 2009 - 02:04 AM.


#34 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 29 March 2009 - 06:06 PM

View PostVineesh, on Mar 27 2009, 09:58 PM, said:

I need a little help with the getsidebar snippet. Right now getsidebar(the default template's main.css in fact) is styled to display the sidebanners on the left side under the listmenu. I want to try moving the sidebanners to the right, while keeping the nav list menu on the left itself. It myt be something simple with a few modifications on the Stylesheet

But i dont wanna risk playing with the layout of our style sheet as i have to bring my production site up without fail today

Yes, it should just be a matter of adding some CSS code... If you haven't already done so, check out http://dahlgren.slyi...getSidebar.html for more information...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users