Jump to content
Sign in to follow this  
winprogger

How to override section.pagination.php ?

Recommended Posts

maycopest

Hey, quick follow-up: I am trying to override the features section. I have copied the whole

features
folder from
platformpro/sections
to
platformbase/sections
, and it isn't working yet. Do I need to rename any of the files? Should I put it in the
platformbase/

root folder instead? I am on PlatformPro 1.3.2 btw.

Share this post


Link to post
Share on other sites
catrina

Why are you copying the whole features folder to the platformbase/sections folder? Is this a different problem?


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
maycopest

No, I thought that's what I needed to do. Do I only need to copy the one main template file? And where would I put it, and what would I name it?

Share this post


Link to post
Share on other sites
catrina

Did you already perform this step?: template.pagination.php to the root of your child and paste the code from the 'template' area of the pagination section there. Then it should override for you.


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
maycopest

Ok, so I think I get the general idea, but it still isn't working. I have gone into the

platformpro/sections/features/section.features.php
file, and copied from line 273:
function section_template() {
to line 385 where the function ends. In my
platformbase/
folder, I created a new file called
template.features.php

, and pasted in the whole function. I made some changes, gave it opening and closing php tags, and saved it. It is still not being used though. What do you think I am doing wrong here? (Also, thanks a bunch for the help, I really appreciate it.)

Share this post


Link to post
Share on other sites
timlinson

Can you paste your template.features.php? And just to make sure, Appearance > Themes shows your active theme as PlatformBase?

Share this post


Link to post
Share on other sites
maycopest

Yeah Tim, you bet. The theme is definitely Base, as I have a bunch of styles that are working great, and I have made some mods to the functions file that shows the site title as well as the page title in the title attribute (which, tangent, should totally be an option, and an easy one to implement to boot). My template.features.php file is as follows:

	<?php
	function section_template() {
	?>
		<div id="feature_slider" class="fix">
			<div id="feature-area">
				<div id="cycle">
				<?php
						global $post;
						global $pagelines_layout;
						$current_page_post = $post;
	
					$feature_posts = $this->get_feature_posts();
	
					if(!empty($feature_posts) && is_array($feature_posts)):
						foreach($feature_posts as $post) :
	
							// Setup For Std WP functions
							setup_postdata($post);
	
							// Get Feature Style
							if(get_post_meta($post->ID, 'feature-style', true)) $feature_style = get_post_meta($post->ID, 'feature-style', true);
							else $feature_style = 'text-left';
	
							if(get_post_meta($post->ID, 'feature-link-text', true)) {
								$flink_text = get_post_meta($post->ID, 'feature-link-text', true);
							}else $flink_text = __('More', 'pagelines');
	
							//Get the Thumbnail URL
							$feature_background_image = get_post_meta($post->ID, 'feature-background-image', true);
							$feature_design = (get_post_meta($post->ID, 'feature-design', true)) ? get_post_meta($post->ID, 'feature-design', true) : '';
	
							?>
							<div id="<?php echo 'feature_'.$post->ID;?>"  class="fcontainer <?php echo $feature_style.' '.$feature_design; ?> fix" >
								<div class="feature-wrap wcontent" <?php if($feature_background_image):?>style="background: url('<?php echo $feature_background_image;?>') no-repeat top center" <?php endif;?>>
									<div class="feature-pad fix">
										<?php pagelines_register_hook( 'pagelines_feature_before', $this->id ); // Hook ?>
										<div class="fcontent <?php if(get_post_meta($post->ID, 'fcontent-bg', true)) echo get_post_meta($post->ID, 'fcontent-bg', true);?>">
											<div class="dcol-pad fix">
													<?php pagelines_register_hook( 'pagelines_fcontent_before', $this->id ); // Hook ?>
													<div class="ftext">
														<?php pagelines_register_hook( 'pagelines_feature_text_top', $this->id ); // Hook ?>
														<div class="fexcerpt">
														<?php
															if(pagelines_option('feature_source') == 'posts') the_excerpt();
														 	else the_content();
														?>
														</div>
														<?php if(get_post_meta($post->ID, 'feature-link-url', true)):?>
															ID, 'feature-link-url', true);?>">
																<span class="pagelines-blink-pad">
																	<span class="blink-arrow featurelink" ><?php echo $flink_text;?></span>
																</span>
															
														<?php endif;?>
														<?php pagelines_register_hook( 'pagelines_feature_text_bottom', $this->id ); // Hook ?>
														<?php edit_post_link(__('<span>Edit</span>', 'pagelines'), '', '');?>
													</div>
													<?php pagelines_register_hook( 'pagelines_fcontent_after', $this->id ); // Hook ?>
											</div>
	
										</div>
	
										<div class="fmedia" style="">
											<div class="dcol-pad">
												<?php pagelines_register_hook( 'pagelines_feature_media_top', $this->id ); // Hook ?>
												<?php if(get_post_meta($post->ID, 'feature-media-image', true)):?>
													<div class="media-frame">
														ID, 'feature-media-image', true);?>" />
													</div>
												<?php elseif(get_post_meta( $post->ID, 'feature-media', true)): ?>
													<?php echo do_shortcode(get_post_meta( $post->ID, 'feature-media', true)); ?>
												<?php endif;?>
	
											</div>
										</div>
										<?php pagelines_register_hook( 'pagelines_feature_after', $this->id ); // Hook ?>
										<div class="clear"></div>
									</div>
								</div>
							</div>
						<?php endforeach; ?>
					<?php else: ?>
						<h4 style="padding: 50px; text-align: center"><?php _e('No feature posts matched this pages criteria', 'pagelines');?></h4>
					<?php endif;?>
					<?php $post = $current_page_post;?>
	
				</div>
	
				<?php if(pagelines('feature_nav_type') == 'arrows'):?>
					<div id="arrownav">
			 			<span id="prev"> </span>
		       			<span id="next"> </span>
					</div>
				<?php endif;?>
			</div>
	
			<div id="feature-footer" class="<?php e_pagelines('feature_nav_type', '');?> <?php  if( count($this->the_feature_posts) == 1) echo 'nonav';?> fix">
				<div class="feature-footer-pad">
					<?php pagelines_register_hook( 'pagelines_feature_nav_before', $this->id ); // Hook ?>
					<?php if(pagelines('timeout') != 0 && pagelines('feature_playpause')):?><span class="playpause pause"><span> </span></span><?php endif;?>
					<div id="featurenav" class="fix">
	
					</div>
					<div class="clear"></div>
				</div>
			</div>
	
		</div>
		<div class="clear"></div>
	<?php }
	?>
	[/code]

Again, thanks so much for the help! All I want to do is get rid of those h2 title tags! I am just using the Features element as a fading photo banner.

Share this post


Link to post
Share on other sites
timlinson

Hey Todd, from what I can tell, you basically just wanted to add: `

` `

<?php the_title(); ?>

` `
` Custom section seems a bit overkill here.. a hook would be more appropriate. Just use the `pagelines_fcontent_before` hook to insert that div: http://www.pagelines.com/docs/base-child-theme

Share this post


Link to post
Share on other sites
maycopest

Well actually I want to get rid of the heading div (but most importantly the h2), not add it. It is the only thing I modified in my custom file. Can I do that with a hook?

Share this post


Link to post
Share on other sites
timlinson

I must have misunderstood your previous post. Well for custom templates, I'm not sure, but based on the other templates, you'd just enter the contents of the function, not the actual function itself. i.e. remove this from the beginning: `<?php` `function section_template() {` `?>` and this from the end: ` <?php } ?> `

Share this post


Link to post
Share on other sites
maycopest

Hmm, that didn't do it either. Is there any documentation anywhere on this whole 'overriding templates' idea?

Share this post


Link to post
Share on other sites
Andrew

Hey guys, Overriding the template is probably unnecessary here.. Just use one of the hooks for the section. e.g. `pagelines_inside_top_pagination`

Share this post


Link to post
Share on other sites
maycopest

Andrew, I am familiar with the idea of adding content with a hook, but not so much with removing (i.e. the h2's) or editing. Could you point me in the right direction to learn that?

Share this post


Link to post
Share on other sites
maycopest

No, more like I am just using it as a photo banner with no text, and I don't want the search engine to see my site as:

  • Title
    • Banner 1
    • Banner 2
    • Banner 3
    • Banner 4
    • Banner 5
    • Banner 6
    • Banner 7
    • Banner 8
    • Banner 9

The tag is never even visible, but I don't like the markup. Trivial? Maybe. Still driving me crazy that I can't figure it out? You bet.

Share this post


Link to post
Share on other sites
maycopest

wow that didn't work at all, I guess you can't do hierarchical lists: edit: I guess you can't indent with spaces either. Anyway, hope you get the gist.

Share this post


Link to post
Share on other sites
kastelic

This thread is getting kind of convoluted. You might want to start a new one clarifying exactly what you are looking for at this point. If all you want to do is remove an

h2
, have you tried setting it to
display:none

in the CSS?

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  

×