Jump to content
Sign in to follow this  
toasthosting

Adding multi-column custom loop

Recommended Posts

toasthosting

Hi everyone, still brand new with PageLines 2.1, so this is a really basic question. On my site, I'd like some boxes at the top, followed by 5 columns with perhaps just an article title and thumbnail. Underneath that I'd like one featured post followed by several 2-column category-based posts. I've got the boxes sorted. I've got 3 custom loops underneath it - one for 1 post from category "special", and 2 custom loops, each with just 2 posts in, from 2 specific categories. That's all working fine (I'm not sure if my coding is that elegant, but I will start another thread about that). My question is this: How do I make a 5-column custom loop to put inside the content area? For a bit of extra guidance, can you tell me how I use the necessary WP hooks inside PageLines to control whether I see an image, or just a headline etc.? Thanks for your help! I can't really show you the site as it's running locally.

Share this post


Link to post
Share on other sites
Rob
Since you're already using boxes, I think you'll need a creative solution. Five columns within the content area will be really small. Do you want this to be dynamic content in the columns or static? Is this supposed to be related to the posts that appear below? There are plugins such as those from [url="http://wordpress.org/extend/plugins/nrelate-related-content/"]nRelate[/url] or [url="http://www.linkwithin.com/learn"]LinkWithin[/url] which allow you to setup 5 columns with thumb and title. This can be added with a shortcode in the page. Alternatively, you could use several other methods, but let's determine of one of those resolve your issue. I'm not sure that a hook is really the solution as there may be several easier ones.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
toasthosting
Hi rangelone - that was some really useful information :) It doesn't quite capture what I'm after, although I'm definitely going to find a use for nRelate. Looks great. Basically, my content column is 750px wide so it can handle 5 columns easily. I kind of want what nRelate provides - but I want to choose my own categories and I want the code to be stored locally, rather than rely on another site spidering mine. So if we make this simple - if I want 5 columns, each maybe 110px wide, with a pic and title, showing the latest posts from a category of my choosing, how can I do it? Thanks again - those plugins have given me some new ideas! It'd be useful to get a proper idea how to make custom looks that use more columns, as I might even create custom templates that, for example, simply list the posts in 3 columns at one point (not saying I will, but if I know how to do it, I can have a play with my designs).

Share this post


Link to post
Share on other sites
catrina
[quote]simply list the posts in 3 columns at one point (not saying I will, but if I know how to do it[/quote] Do you want one post per column? I feel like this can be accomplished by creating some kind of grid, except there would only be one row of boxes (columns).

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
toasthosting
Yeah definitely 1 post per column, and I'd definitely only want one row. If I can learn how to do it for x- number of columns, I can learn more about making custom loops for other purposes in PageLines. Thanks :)

Share this post


Link to post
Share on other sites
Jenny
Make sure you check out http://www.pagelines.com/wiki/Developer_Docs Our php support on this forum is limited.

Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites
toasthosting
Unfortunately, from what I can see the Developer Docs are almost non-existent. Commonly asked questions - coming soon. Function reference - coming soon. PageLines Options - coming soon. Developing PageLines sections - coming soon. Developing PageLines themes - coming soon. Developing PageLines plugins - coming soon. I don't know which Developer Docs you wanted me to check out :D Isn't it possible to just build a custom loop, passing parameters to a PageLines hook etc.? I don't really want to get right into PHP programming, I'd just assumed that PageLines was built with enough hooks to allow me to customise the output of the loop. I can see that the construct for the PageLinesPosts class sets the number of clips at 2 ($this->clipcount = 2), for example, but I don't know if I can override this by passing in the variable name or by adding a hook myself. The problem is, the lack of documentation means I'm doing a lot of guessing, and I don't honestly know what PageLines will let me do.

Share this post


Link to post
Share on other sites
catrina
Yes, sorry about that, the docs are still be worked on (I'm not sure when they'll be ready). You can try e-mailing developers@pagelines.com with your question.

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
toasthosting
Don't apologise Catrina, I'm not annoyed or anything :) in fact I wish I had some more time cos it'd be useful for a newbie to document their experiences so they could help the people who write the documents. For example, the way you've set the "how-to" section up is "how to use X feature". My view is, it should be task-based: "How to add a column" for example. I guess what I'd really like to see is a meshing together of PL docs with WP docs - because I think my confusion arises from not being clear where I need to interact with WP functions/settings and where I need to interact with PL ones. But that's for another thread :) If I was working with a "pure" WP theme, I would know how to answer my question about 5 columns etc.

Share this post


Link to post
Share on other sites
toasthosting
I've dropped an email as you suggested Catrina. I've said that if I can learn how to do it, I could maybe help write a tutorial about it, because I think such tutorials would be really well-received. I'll post any response I get, and then close off the thread.

Share this post


Link to post
Share on other sites
toasthosting
Actually Catrina could you expand on this: [i] Do you want one post per column? I feel like this can be accomplished by creating some kind of grid, except there would only be one row of boxes (columns).[/i] Again, bear in mind that I might just be getting confused between what PageLines expects and what WP expects.

Share this post


Link to post
Share on other sites
Rob
Okay, since you prefer categories, that's a whole different set of criteria, so let's get this done for you. You'll want a plugin called "Special Recent Posts". I'd recommend getting the paid version, but try the free one first. It's pretty darn good. http://wordpress.org/extend/plugins/special-recent-posts/ This plugin uses shortcodes. So, let's say you set up your 5 boxes, one row. In Box 1, you'd write a shortcode to include the thumbnail based on Category 1 with nothing else. You'll probably have to exclude things like title, excerpt, etc. Then, in the same box, you add a second shortcode on the 2nd line, this time also set for Category 1 and including the title only, linked. Do the same thing for Boxes 2, 3, 4, 5, each with a single category, different from the others. Make sure you're using the same display settings in the two shortcodes for how posts will display (ie., descending or ascending, never random). You may need to do some CSS later to style the font size for the title. But this is only a possibility. Why two shortcodes? Largely because the plugin normally puts posts in a typical blog layout with the image left of the title, and/or excerpt. By doing it in two shortcodes, you have one with linked thumb only, and another with linked title only. If the order is set to the same, they will match. Be careful with the boxes because there's padding between them. You may need to adjust that too. But let's not do things till we need to, as I'm sure you'll agree. One little note. Once you've completed the settings (shortcodes) for Box 1, you can copy and paste the shortcodes to the other boxes ONLY changing the categories each uses.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×