Trying to figure something out, any help would be appreciated

thatpatguy's picture
public
group: Ottawa
thatpatguy - Wed, 2008-06-25 19:06

Hiya everyone,

So I'm trying to solve a problem here but I just can't completely wrap my head around the way to do it. Hopefully some of you can provide a solution or new insight that help me out here. I'll do my best to explain what I'm trying to do.

I want to create 3 or 4 custom content types what will act almost like blocks (the client is calling these things "buckets" so for the rest of this post I will as well). They will contain just a small amount of content, with like a call to action or some sidebar type of content to compliments the body of the node being displayed. And, like one would usually do with blocks, they will be displayed in a sidebar region on the page.

What I want is to create a content type for each type of bucket (lets say I have two, a "call to register" bucket and a "contact us" bucket), that way the site maintainer will be able to create as many "contact us" buckets as they want, each with it's own unique content.

That's the easy part and I've got no problem setting all that up. Where I'm getting stuck with now is the following.

Once I've created my "buckets" how do I set it up so that bucket 1 will only display on page 1 and page 6 and bucket 2 will only display on page 3.

What I want is something like the "Page Specific Visibility Settings" that you have with a block, but I don't know how to set that up with a custom content type.

I want to associate these buckets to pages rather than nodes because in some cases they need to be displayed on a page that just displays a single node and in other cases they need to be displayed on a page that renders a view.

Up to now I've just been delivering this content by creating a block for each bucket needed and setting the page specific visibility setting to get it to display on the appropriate pages. This isn't a good long term solution for me though because it makes it "too difficult" for the client to add more buckets when they want to.

I may be trying to tackle this problem from entirely the wrong direction so any thoughts would be greatly appreciated. Thanks everyone!


oh yeah.. I forgot to

thatpatguy's picture
thatpatguy - Wed, 2008-06-25 19:23

oh yeah.. I forgot to mention.. I'm working with Drupal 5.7 :)

Pat Cooney
Web Application Developer
RealDecoy


I think I might finally be

thatpatguy's picture
thatpatguy - Wed, 2008-06-25 19:27

I think I might finally be onto something here: http://drupal.org/node/134425

Pat Cooney
Web Application Developer
RealDecoy


yup, that will work

liquidcms's picture
liquidcms - Wed, 2008-06-25 23:47

snippet from the link you posted should work; but they are doing both path (url) and node type selection for displaying your block.

if you all need is path based.. i.e. "I want to associate these buckets to pages rather than nodes" then the simlpe non-php coded block selection should work for you.

for example if you are NOT using pathauto (which is bad, since you should always use it).. then your pages are something like node/23, node/35, node/67, etc.. so if you just add this list to your "pages to show block on" for that block

but this is the default behavior for setting up blocks; so perhpas i am not getting what you are trying to do???

Peter Lindstrom
LiquidCMS - Content Management Solution Experts