Skip to:
Content
Pages
Categories
Search
Top
Bottom

Default template confusion?


  • hitkid
    Participant

    @hitkid

    I’m trying to get rid of and change the layout of the: bbp-template-notice info and bbp-breadcrumb, in the topics index. So Home>Forums>Test Topic. I’m having trouble figuring out if there is a bug, or I’m missing something, or I just have the template hierarchy wrong.

    How I believe the template hierarchy works: archive-topics.php>content-archive-topics.php>loop-topics.php>loop-single-topics.php

    I figure the changes I would need to make would be in archive-topics.php or content-archive-topics.php, but when I delete the <?php bbp_breadcrumb(); ?> as a test it’s still there.

    When I make changes to loop-topics.php and loop-single-topics.php, it works fine. It’s just those two page templates.

    I’ve tried editing the bbpress.php file from:

    <?php /* Start loop */ ?>
    	<?php while (have_posts()) : the_post(); ?>
    		<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
    			<header>
    				<h1 class="entry-title"><?php the_title(); ?></h1>
    			</header>
    			<div class="entry-content">
    				<?php the_content(); ?>
    			</div>
    		</article>
    	<?php endwhile; // End the loop ?>

    and swapping the content for <?php bbp_get_template_part( ‘content’, ‘archive-topic’ ); ?>. That worked but it messed with my forums index.

    I’ve taken a look in the codex to try and figure out what I’m doing wrong and feel lost.
    tep-by-Step Guide to Creating a Custom bbPress Theme

    Getting Started in Modifying the Main bbPress Template

    Sorry if this is a bother, but I’m completely stumped as to what’s going on

Viewing 11 replies - 1 through 11 (of 11 total)

  • Robin W
    Moderator

    @robin-w

    if you want to get rid of the breadcrumb use

    Layout and functionality – Examples you can use

    what else do you want to achieve?


    hitkid
    Participant

    @hitkid

    Thank you @robin-w for the great and speedy reply.

    I was just trying to remove the breadcrumb in the content-archive-topics.php template to test if that’s the file I’m suppose to edit. Really I want to rearrange and do a whole lot of different things. Like what it says in the Amending bbpress templates codex entry.

    Note* All the forum templates work great! Unlike the topic templates, any change I make to these files appears in the forum index as they should: archive-forums.php>content-archive-forums.php>loop-forums.php>loop-single-forums.php

    That’s a great entry in the codex.

    7. How can I remove all the breadcrumbs from the templates and set them at the top of the page?

    Moving around the breadcrum is more of what I want to do, but I can’t find the template file for the topics to add the <div class=”truebreadcrumbs”> to the bbp_breadcrumb(); to be able to use css to move it around. If that makes sense.

    Sorry if I’m being confusing and I thank you very much for your help ๐Ÿ™‚

    What you should do is tweak the arguments passed to the breadcrumb so you can add/change the CSS classes (and or HTML elements) for the breadcrumbs, the plugin extends what is already listed in the codex docs and shows you all of the options available and you should be able to tweak it for what you are after.

    https://gist.github.com/ntwb/7781901

    Layout and functionality – Examples you can use


    hitkid
    Participant

    @hitkid

    @netweb Thank you very much! I will try this.

    The only thing I’m kind of left confused about is how the index for topics works? In the Amending bbpress templates codex entry it states the templates for forums work like this:

    The index for the forums starts by using

    content-archive-forum.php

    If you open this up you will see that it them calls a further template by using the function bbp_get_template_part

    <?php bbp_get_template_part( โ€˜loopโ€™, โ€˜forumsโ€™ ); ?>

    (this translates to loop-forums.php)

    this in turn calls

    <?php bbp_get_template_part( โ€˜loopโ€™, โ€˜single-forumโ€™ ); ?>

    (this translates to loop-single-forum)

    and so on.

    So the template hierarchy for the the forums index would look like this:
    archive-forums.php>content-archive-forums.php>loop-forums.php>loop-single-forums.php

    Would the template hierarchy for the topics index look like this:
    archive-topics.php>content-archive-topics.php>loop-topics.php>loop-single-topics.php

    Thanks again for taking the time to help me!

    Cool, and yes what you wrote above is correct for the topic template hierarchy.


    hitkid
    Participant

    @hitkid

    Thanks again @netweb

    Okay, I’m glad too see I wasn’t editing the wrong templates. I was paranoid that I was doing that. Unfortunately, this means something is going on with my archive-topics.php and content-archive-topics.php templates. The other two work great.

    What I’m trying to do is add things like: elements, classes, ids, functions I’ve built move around the functions already in the archive-topics.php and content-archive-topics.php templates and so on. When I do this and save changes they don’t appear.

    It doesn’t even look like my topic index is using the proper templates because in the content-archive-topics.php template file there is a search function that isn’t appearing in the topic index when I click on a topic off the forum index. eg home>forums>this-is-a-topic.

    Also you can create a topic on the topic index page in the website, but I can’t find a call to the form-topics template in any of the topic templates stated in the topic heiarchy. Unless it’s called in another way that’s not something like this:

    <?php bbp_get_template_part( 'form', 'topic' ); ?>

    What could be going on and why could this be ?

    Again I thank you for your help!

    If you want paste your templates (or code snippets) in a Gist and I’ll take a look and see if anything stands out… https://gist.github.com/

    Unless you have named the files incorrectly, this is what they should be:

    content-archive-topic.phploop-topics.phploop-single-topic.php

    You have an extra s on two of the three ๐Ÿ˜‰

    Ooops, for the topic form, take a look in content-single-forum.php and you’ll find:
    <?php bbp_get_template_part( 'form', 'topic' ); ?>


    hitkid
    Participant

    @hitkid

    @netweb content-single-forum.php was it!

    Turns out there is an “is not” bbp_is_forum_category() conditional statement that might be the reason it’s using that template.

    Is this meant to be like that? Here’s the Github paste of the conditional in content-single-forum.php

    Please also put a link where I can donate a bit of money to bbpress(if there is one)!

    Thank you so much ๐Ÿ˜€


    hitkid
    Participant

    @hitkid

    Never mind I totally understand what’s going on now! Again, thanks so much for the help ๐Ÿ™‚ I wish there was something I could do to help out, but I don’t think you guys have a donate button

    Excellent, glad your on track to getting your custom templates up and running ๐Ÿ™‚

    Your correct, we don’t have a donate button, but we’re always on the lookout for extra hands, we need more docs on doing what you doing currently, Robin has already written some introductory docs here.

    Pretty much anything goes, we need lots of docs written for our codex and anyone can create new and/or edit existing docs, so if you feel the urge to contribute that way if that’s your thing, that would be great. ๐Ÿ™‚ If not we’ll also be having some other initiatives in the new future. ๐Ÿ™‚

    Participate & Contribute

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Skip to toolbar