Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Theme selection not changing site look

edited May 2012 in Design

I have downloaded the Montreal theme as well as some others. I uploaded them into the layouts folder. I go to Tools/Designer...and click Make Default next to the layout I wish to use. I go back to my home page but it still looks exactly the same. I have cleared the cache but see no difference. Any suggestions?

«1

Comments

  • I am assuming I need to change the line:

    {% if id == 'index' %} to {% if id == 'default' %} based on a thread I just read?

  • If the theme default has changed (refreshing the Tools > Designer page still shows Montreal as the default), then you're probably getting hung up on the same thing I always do:

    The default homepage has a custom layout setting set to 'index'. You have to change that back to 'default' and it should pick up the correct default template.

    I just fixed this a few days ago for the next beta update, by merging the default and index templates into one, so this should stop confusing people soon! :)

  • And you shouldn't have to edit the layout files to fix, just the index page's layout value.

  • I am confused now lol. I am on the Designer Page. Under layouts...I have selected Montreal and clicked make default. Now what exactly do I do?

  • Okay, go to the homepage of the site and click the Edit Page button. Under the Extra Options in that form, change the Layout value to "Default" and save the page. If the Montreal theme has been set to be the default, then it should switch to using that.

    Let me know if that fixes it :)

  • Oh...okay...I was looking in the index.html coding. LOL Sorry.

  • Haha, no prob :)

  • Okay...I was successfully able to change to the Montreal theme. I decided to check out a different theme. So...I clicked on inflicted and Make default. Then I went to edit page and default was still selected so I refreshed but its not working. The only theme that is working is the custom one I downloaded from the Theme Builder page. Any ideas?

  • That's strange. Can you post a listing of your layouts folder? Also, can you verify that conf/config.php has the right theme in the default_layout setting? If so, then if you create a new page and leave the layout setting alone, what theme does it use?

  • edited May 2012

    Layouts folder includes jbroadway-themename and the admin, default, and index.html files. The theme being used looks just like the default except no image slideshow functionality nor image.

    Default layout ="Montreal"

  • edited May 2012

    Ah I see. Did you do a git clone to grab the Inflicted theme? If so, you'll have to rename the folder to inflicted instead of jbroadway-inflicted. That's most likely what it is (and something I should make clearer in the various theme and app readme files).

    If you're running the latest master of Elefant from Github, you can also install apps and themes in two ways:

    1. Go to Tools > Designer and click on Install App/Theme. Paste the ZIP link from the app or theme's Github page into the form and it'll install for you.

    2. Using Composer, create a composer.json file in the root of the site like this:

    {
        "require": {
            "elefant/app-analytics": "*",
            "elefant/app-sitemap.xml": "*",
            "elefant/theme-washi": "*"
        },
        "config": {
            "vendor-dir": "lib/vendor"
        }
    }
    

    Then run composer.phar install and it'll install everything listed there.

  • edited May 2012

    I didn't have the github version but I do know. Just replaced the files. Now I have the Install App/Theme link under Designer. Thanks for the info. Now I need to go read up on customizing the look. I think its a great and simple webapp you have created....and I also think with theming, it can be made to look awesome.

    And just so you know, I didn't have to do the index to default step either. They are switching as should.

  • Thanks, glad you like! Any theming help is more than welcome :)

    And good to know my recent fix gets rid of the index page theme confusion!

  • Yeah...that was a great relief. Works flawlessly now. Changes on the fly. Do you have any documentation on how the framework is laid out? I am no expert programmer but teaching myself more and more each day. I am trying to grasp how one can actually build off of it. By the way, sent you a message and promotion on Twitter.

    Thanks

  • Thanks! There is quite a bit of documentation, although it could be better organized... I broke it down into install, user manual, admin, designer, and developer, to try to make it easier for non-developers to find that info.

    The developer section is the part that needs the most cleanup, but I'd probably suggest starting with the developer tutorials would give you the best info with examples as well. Here's a link to that:

    http://www.elefantcms.com/wiki/Developers#tutorials

    Here's also a big overview of how pages are routed to individual scripts, and how those scripts receive and respond to the page request:

    http://www.elefantcms.com/wiki/Page-routing-and-handler-basics

    Hope that gives you a start!

  • Thanks bud...I will check out those links. One question real quick that I did have...I am editing the main page. I want to add a block and embed blogs in there. I notice that I can embed Dynamic Objects such as the Blog latest posts...what I would like is a running blog like for instance the post feature of Wordpress sites. Can this be done?

  • What I usually do to setup a blog page on a new site is this:

    1. Create a new page, call it Blog but set the ID to something like 'news' since /blog will take you to the blog.

    2. In the Dynamic Objects menu, find Pages: Redirect Link and point it to /blog (use a permanent redirect if it gives you the choice, which the new betas should).

    3. Go to Tools > Navigation and add your newly created blog alias page to the site tree where you want it to be.

    4. Edit apps/blog/conf/config.php to adjust the blog's settings.

    To make the blog the main page of the site, skip 1 & 3 and just do step 2 on the main index page. That will cause the site to redirect visitors to /blog as soon as they hit the homepage, so the first page they see is your blog.

    When you're logged in as an admin, the redirect doesn't occur automatically, instead it prints a message in the page like this:

    This page forwards visitors to the following link: /blog
    

    That way as an admin you can still access the alias page to edit it if you need to later on. Let me know how it goes!

  • edited May 2012

    ElefantCMS just keeps getting better and better. I was successful on doing that. Now...question. What I would like to do is this if possible...I have the few news bits at the top that comes from the install...Congratulations, Getting Started, and Developers. On that page, I put in a horizontal line. Is it possible to display the blog posts in full under that line versus doing a redirect? If not, I can just add blog to the nav menu and it will just have to reside on a separate page.

    One other thing...I notice that pretty much any theme I add an image to the body of the page...it shows up regardless of which template I use. However, if I use the blue satellite theme which has a sidebar...I add things to it like social buttons and such...but that doesn't show up on any other templates. is that because the other templates aren't coded to have sidebars I am assuming?

  • edited May 2012

    I don't believe there is a way to do what you wish with the built in embeds. Here is a start to a solution that I believe you are looking for though. (Not tested very well, but it worked.)

    In /apps/blog/config/embed.php

    [blog/postsfeed]
    label = "Blog : Posts Stream"
    
    number[label] = "Number of Posts"
    number[type] = numeric
    

    In /apps/blog/handlers/ > create postsfeed.php

    <?php
    require_once ('apps/blog/lib/Filters.php');
    
    
    if ($data['number'] !== '') {
        $page->limit = $data['number'];
    } else {
        $page->limit = 5;
    }
    
    $page->offset = 0;
    
    $p = new blog\Post;
    $posts = $p->latest ($page->limit, $page->offset);
    $page->count = $p->query ()->where ('published', 'yes')->count ();
    
    if (! is_array ($posts) || count ($posts) === 0) {
        echo '<p>' . i18n_get ('No posts yet... :(') . '</p>';
        if (User::require_admin ()) {
            echo '<p><a href="/blog/add">' . i18n_get ('Add Blog Post') . '</a></p>';
        }
    } else {
        if (User::require_admin ()) {
            echo '<p><a href="/blog/add">' . i18n_get ('Add Blog Post') . '</a></p>';
        }
    
        foreach ($posts as $post) {
            $post->url = '/blog/post/' . $post->id . '/' . URLify::filter ($post->title);
            $post->tag_list = explode (',', $post->tags);
            $post->social_buttons = $appconf['Social Buttons'];
            echo $tpl->render ('blog/postsfeed', $post);
        }
    }
      ?>
    

    In /apps/blog/views > create postsfeed.html

    {! admin/util/dates !}
    
    <div class="blog-post block">
    <h3><a href="{{ url }}">{{ title }}</a></h3>
    <p class="blog-info info">{{ ts|I18n::date_time }} - {" by "} <a href="/blog/by/{{ author }}">{{ author }}</a></p>
    {{ body|none }}
    <div class="blog-tags info">
    {"Tags"}: 
    {% foreach tag_list %}
    <a href="/blog/tag/{{ loop_value|trim|strtolower }}">{{ loop_value|trim|ucfirst }}</a>
    {% end %}
    </div>
    <hr />
    <div class="blog-comments">
    {{ controller.run ('blog/commentcount', $data)|none }}&nbsp;
    {% if social_buttons['facebook'] %}
        {{ controller.run ('social/facebook/like', $data)|none }}
    {% end %}
    {% if social_buttons['twitter'] %}
        {{ controller.run ('social/twitter/tweet', $data)|none }}
    {% end %}
    {% if social_buttons['google'] %}
    {{ controller.run ('social/google/plusone', $data)|none }}
    {% end %}
    </div>
    </div>
    

    This should give you a quick embed widget that will put as many full posts as you desire wherever you want them.

  • edited May 2012

    Okay...I have done what you said. I edit the main page and click on Dynamic Objects. I select Blog : Posts Stream. I put in 10 for the number of posts. I click on Save. Now...my index page has nothing on it except a link that says Add Blog Post.

    Luckily I was able to press Back button a few times and remove the embed and save to get my site back. I couldn't even access the admin panel. Now it's back to normal.

    What do you think is wrong?

  • edited May 2012

    Hmm. Do you have any blog posts currently?

    I can't seem to replicate that. What theme are you using?

    The only thing I can think of is you didn't name your html file correctly, but that should have been simply displayed as an error. Hmmm.

  • edited May 2012

    I do have one blog post. I am using the bluesatellite theme. I just tried a different theme and it does the same thing. I added the embed code you wrote to the existing embed.php file that was in the folder. I created the other 2 files and pasted the coding in and saved them in the folders you specified.

  • I figured out the problem. I give you permission to slap me on my head my friend. I accidentally posted the code from postsfeed.php to postsfeed.html hence the reason all the html coding was gone and only listed a link to Add Blog Post.

    For some reason when I copied the coding I apparently didn't Ctrl-C.

    Sorry bud!

  • Haha. That would do it too. :)

    Glad you got it figured out.

  • edited May 2012

    Thanks a lot! Should make that code into a plugin for others. Great work.

  • I agree, I think that should be another dynamic embed option for the blog app.

    @shortj, would you like to submit a pull request with those additions, or should I add them myself?

    Also, I think you can eliminate the postsfeed.html template and just use blog/post as the template in postsfeed.php

  • edited May 2012

    I'll do it! Give me a bit.

    I also believe you are right with the blog/post. The only reason I utilized a different one was in case people wanted to edit how that looked without effecting the other posts.

  • edited May 2012

    This will be an awesome feature to add. Makes it more Wordpressy like if that makes sense...gets you hanging with the big boys for sure. Also...I agree...after reviewing...doesn't look like you really need the html page since there is an existing template for the post.

    I changed this line echo $tpl->render ('blog/postsfeed', $post); to echo $tpl->render ('blog/post', $post); and it works great...but you're right, you can't style it as you can with an html template.

  • I pushed a commit that uses the standard post view. If anyone wants to update the view particular to that widget they can do so on their own.

    As for hanging with the big boys, have you seen the elefant benchmarks? :D Jbroadway knocked it outta the park.

  • No sorry I didn't. LOL...but I see them now. That's awesome. In regards to the updated view...is it only what I changed? Or should I get the newly updated one you pushed?

Sign In or Register to comment.