Jump to content
Sign in to follow this  
billortega

Custom Section/Template/etc How To?

Recommended Posts

billortega

I am totally confused. I need several of our posts/pages to go full width (92%) of a browser screen, while the rest of the posts/pages to remain at 960 px wide. However, the fullwidth settings in Pro and Base only give me options in pixels through admin interface. I have tried to create a custom section (section.fullwidth.php) but I have no idea where to get the php code that draws the actual page. My thinking was that if I can put that code in the section and then use a custom css then I could force that template to go full width. Am I wrong? can someone help? Thank you.

Share this post


Link to post
Share on other sites
billortega

Let me give you an example of what I am trying to achieve: I've looked through the tutorial on GlobalNav Section creation, but I have questions... first, I've copied (in Base) sections.pullquote.php and renamed it sections.fullwidth.php. In it I changed to the following:

 class ContentFullWidth extends PageLinesSection {
	   function __construct( $registered_settings = array() ) {
		// BASIC INFO
		/* The name and ID of the section */
		$name = __('Content Full Width', 'pagelines');
		$id = 'fullwidth';
	
then I changed the settings:
	// SETTINGS
	// Setup description of the section..
	$default_settings['description'] = 'Displays content of certain pages in full screen width.';
	
	// The template areas this section works with..
	// Examples areas: 'main', 'content', 'header', 'footer', 'morefoot', sidebar1, array('main', 'content'), etc....
	$default_settings['workswith'] = array('main', 'content');
	
	// The icon users will see in the admin.. add the full url here
	$default_settings['icon'] = CHILD_IMAGES . '/icon-pullquote.png';
	
Did i chose the right array? I put array('main', 'content') Is that correct? Next,
	/* Use this function to create the template for the section */
	 	function section_template() {
	

but what do I put here? I need something that will load content, not GlobalNav Section... What code do I need to put here? Please help!

Share this post


Link to post
Share on other sites
cmunns

First things first. Try referenceing the section.fullwidth_sidebar.php for the right placement array What content are you trying to add? You can put absolutely anything inside of that function...

Share this post


Link to post
Share on other sites
billortega

Adam, Thank you for your response. Unfortunately it didn't help me at all. For one thing, I couldn't find a file "section.fullwidth_sidebar.php", so I really couldn't get past that first step. I have downloaded Platform Pro 1.5 and Platform Base. Both are installed and Platform Base theme is currently active. All I really want to achieve is to: 1. "Page/Post-A" to have a fixed width of main content column (960px, for example), using template or section in WordPress Admin interface. 2. "Page/Post-B" to have a fluid width of main content column (100%, for example). 3. "Page/Post-C" to have a fluid width of main content column (100%, for example) with fixed width sidebar (350px wide, for example). I get it that I can easily control the actual widths with a custom CSS in Base theme... but... I am lost as to what to put in the custom section that I made using PlatformPro Youtube tutorial (GlobalNav Section). In that tutorial, the author uses "wp_nav_menu" to call a WordPress function for menus... I don't need menus, I need main content of the post/page to be called in that custom section. but I can't find anything that will give me an example of how to call "contents" of a post/page... I am nearing the proverbial breaking point with Platform... Please, don't get me wrong! I am not saying that it is fault of the PP, quite the opposite. I blame myself. I thought (from the demos) that this process would be straight forward, so I bought the license. I am not experienced with PHP, and was hoping that admin interface will give me that option of selecting widths in percentages instead of pixels, etc... and now, I feel stupid, because I can't help but to seek some sort of step-by-step instructions, or abandon Platform and go look elsewhere. bill.

Share this post


Link to post
Share on other sites
cmunns

You want to show a custom loop? Tell us more information on the content you are trying to show and I'll help you out,...be very specific on what type of content you want to show and how

Share this post


Link to post
Share on other sites
billortega

Adam, Thank you for your willingness to help. I'll try to explain the best I can. Here's the situation... It has to do with display of post/page content, not the header, not the breadcrumbs, not the footer. The "content" that you normally enter in the main body of any post/page. For most pages and posts on our site, the out of the box width of 960px is just fine. However, there are several pages that will require the content to stretch beyond 960px and need to be flexible to go 95% of the browser window width. Does that make sense? In these special cases, the header, the breadcrumbs, and the footer stay as they are (fixed width, centered on the page). At the same time, the midsection (main content of the post/page entry) shoudl be flexible, stretching from side to side. i.e. (normal page, vertical layout): <fixed width 960 px - header > <fixed width 960 px - breadcrumbs > <fixed width 960 px - POST / PAGE CONTENT > <fixed width 960 px - footer > i.e. (fullwidth page, vertical layout): <fixed width 960 px - header > <fixed width 960 px - breadcrumbs > <fixed width 95% - POST / PAGE CONTENT > <fixed width 960 px - footer > can this be accomplished? --- My thought was that I need to create another (custom, let's call it "fullwidth") section that draws the main layout of any given page just like a normal section would, but the html tags would be different so that a custom CSS would tell the new "fullwidth" section to stretch the content window to 95%. However, I cannot for the life of me to find anywhere in PlatformPro or PlatformBase any section that shows how it assembles a post/page. please help. bill

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  

×