Jump to content
Sign in to follow this  
a9k3d

Overriding section.carousel.php

Recommended Posts

a9k3d

How do you do overide it exactly? Copy to base or make register a custom section? Do you need the WHOLE section/carousel folder? I have several custom sections already so I could go that route but it seems excessive for a small mod to an existing section. I took the original and copied into my base under sections/carousel/. That's not working. I tried the whole folder also, no go. I would see a change in the admin wording if it worked. I've changed from category to tag selection so I can use a tag of "page1" for front page features. Using the hook is out - I would loose the flexible admin interface, ie limit on number of boxes.

Share this post


Link to post
Share on other sites
catrina

What are you looking to do when you override the section.carousel.php file? You wouldn't need the whole folder, just the file.


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
a9k3d
changed from category to tag selection
Client wants the carousel selection by tag so just her "hot" posts show.
alan@wp:~/wp/wp-content/themes/solari2/sections/carousel$ ls
	section.carousel.php
There it inside their theme in the right place. I've inserted an H1 to prove which carousel I'm getting:
function section_template() { ?>
	<h1>PLATFORMPRO carousel</h1>
or
<h1>A9K carousel</h1>
I'm getting PLATFORMPRO. So my code is not run. The question remains do I have to override this line (and create a custom section):
 $name = __('PageLines Carousel', 'pagelines')

Share this post


Link to post
Share on other sites
kastelic

All you have to do to override the section is make a new file called template.carousel.php and place it in the root of your child them. Then copy the contents of the carousel template function into the new file and it should override. For example you see

function section_template() { ?>

? Just copy the code within this function, not the whole function. This thread might explain this clearer for you: http://www.pagelines.com/forum/topic/4957

Share this post


Link to post
Share on other sites
a9k3d

Carousel is a section and it doesn't have a template. I have 4 custom sections already but carousel just doesn't seem to fit any of the patterns. It has it's own directory under sections. If I move the section.carousel.php to root, rename template.carousel.php and change class (because it throws an dup class error against PageLinesCarousel) then I get no carousel at all. So I don't think your suggestion is correct. Mixing sections and templates doesn't make sense.

Share this post


Link to post
Share on other sites
kastelic

I promise, this is the way you do it! How about if I'm wrong I'll paypal you ten bucks? Just make sure you are copying the html/php code within the section_template() function in section.carousel.php, not any of the other functions.

Share this post


Link to post
Share on other sites
a9k3d

It did work once I removed all other functions. Sorry I was so testy but I'd been working on the project 8am-2am for a week. It is a very odd over-ride mechanism in comparison to the rest of PlatformPro. The post you refer to shows the confusion by it's length. My notes now say:

  1. Find "section_template()" in the section.____.php
  2. Copy the HTML from div to /div from that function
  3. Paste that into a template.____.php in your base root.
Does that sound right? Are there exceptions to that rule?

Share this post


Link to post
Share on other sites
cmunns

No it works in all cases, you just might not always be able to change what you want bc it may not be inside the section_template function e.g. js parameters inside feature sections.

Share this post


Link to post
Share on other sites
a9k3d

Great. I think we now have a good summary for the next frontier explorer heading into sections.

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  

×