ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Help with blog style integration

January 21, 2011 6:31am

Subscribe [5]
  • #1 / Jan 21, 2011 6:31am

    LewisSellers

    14 posts

    Hi There,

    I’m new to Expression Engine and we’ve been working on a Charity website for a client.

    Basically, what I’m trying to achieve is a particular layout for a past trips page.

    When the user clicks onto ‘Past Trips’ they’ll be shown a group of countries that will be inserted by us. The user will click on this and get to a secondary page that shows a list of years, images and a brief description of each trip to that particular country.

    On that page, there needs to be a read more that then takes the user to a ‘case study’ page where they’ll learn in a lot more depth what happened on that particular trip.

    What I want to do is make it that expression engine fills in the second level page automatically. So all our client has to do is fill in some forms on the third level page with his information in, and expression engine will dyamically give a link called ‘More information’ and take the summary box and image onto the second level page.

    Is this possible with standard expression engine or would I have to look into some sort of modification?

    I hope I make sense!

    Any help would be fantastic.

    Kind Regards
    Lewis

  • #2 / Jan 21, 2011 4:31pm

    Sue Crocker

    26054 posts

    Hi, Lewis.

    What you’d need to do is create a single entry page that displays the content you want to see.

    The client would fill out an entry form with the summary, image, and the moreinfo fields. You’d create a link to each detail page.

    See this page from the EEDocs: http://ellislab.com/expressionengine/user-guide/modules/channel/variables.html#var_comment_url_title_auto_path

    Does that help?

  • #3 / Jan 27, 2011 9:05am

    LewisSellers

    14 posts

    Hi Sue,

    Thanks for your help.

    The EEDocs link you sent over really helped. I ended up pulling in the full version but used the TruncHTML Plugin, limiting the {Page_Body} tag and then putting a link in to the original full version without any limit on. It’s done the exact requirement so that’s all good. Thanks for your help!

    Next question, I’m trying to get the Meta Section of the site up and running. At the minute, the site has 5 or 6 template groups for the front end. What I’m trying to do is pull in the information from two custom fields I’ve setup in the admin - {meta_keywords} and {meta_description}.

    At the minute, all the template groups share two embed files for the header:

    Homepage uses ‘header’
    All the internals use ‘header_int’

    What I’ve got at the moment is the following in my embeds script:

    {exp:weblog:entries limit=“1” rdf=“off” disable=“category_fields|member_data|pagination|trackbacks”}
    <meta name="keywords" content="{meta_keywords}" />
    <meta name="description" content="{meta_description}" />
    {/exp:weblog:entries}

    When I go to the front end of the site, it’s ‘kind of’ rendering properly. Currently it shows the following:

    <meta name="keywords" content="" />
    <meta name="description" content="" />
    
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    
    <meta name="keywords" content="KEYWORDS ARE APPEARING HERE" />
    <meta name="description" content="DESCRIPTION HERE" />
    
    <meta name="keywords" content="" />
    <meta name="description" content="" />

    I’ve only filled in Meta Keywords and Descriptions for one page and it’s displaying all the pages. This means that it’s not showing ‘JUST’ the page that we are on.

    Is there a way around this?

    Hope I make sense! 😊

    Kind Regards
    Lewis

  • #4 / Jan 27, 2011 5:59pm

    Ingmar

    29245 posts

    You are using curly quotes for some of your parameters (limit in particular). Please correct to use simple quotation marks instead.

  • #5 / Jan 28, 2011 7:51am

    LewisSellers

    14 posts

    Thanks for the quick reply.

    You’ve solved half the problem so thank you for that!

    The code now looks like the following:

    {exp:weblog:entries limit='1' rdf='off' disable='category_fields|member_data|pagination|trackbacks'}
    <meta name="keywords" content="{meta_keywords}" />
    <meta name="description" content="{meta_description}" />
    {/exp:weblog:entries}

    Basically, the duplication of the meta tags now dissapears, so it’s only displaying 1 per page (which is exactly what it should be doing. However, the problem comes that the same Meta Keywords and Descriptions are appearing on every page.

    As far as I can tell, it’s using the latest articles meta tags / keywords instead of the page that the customer is on.

    Does anyone have any advice?  -  Just to confirm, I’m using EE v2.1.1.

    Thank you for all your help.

    Lewis

    Kind Regards
    Lewis

  • #6 / Jan 28, 2011 4:04pm

    Sue Crocker

    26054 posts

    Hi, Lewis. First things first - your syntax is off. You’re trying to use EE1.x instead of EE2.x syntax.

    meta_keywords and meta_description are what kinds of fields? Are they custom fields for the channel?

  • #7 / Jan 29, 2011 6:57am

    LewisSellers

    14 posts

    Hi Sue,

    Ah right, I’ve been doing a lot of research on Google but I had a feeling the syntax may have been wrong… I thought I’d mention my version of EE in my last post incase I was wrong 😊

    meta_keywords and meta_descriptions are custom fields i’ve added into the ‘simple_content’ field group.

    Kind Regards
    Lewis

  • #8 / Jan 30, 2011 11:39am

    Greg Salt

    3988 posts

    Hi Lewis,

    Please post the exact code you are using in your embed now that you have corrected the code for EE 2.x and can you provide us with a link to the site so we can see what is happening?

    Cheers

    Greg

  • #9 / Jan 31, 2011 6:21am

    LewisSellers

    14 posts

    Hi Greg,

    Currently, I’m still on the EE 1.x code as I’m not sure what I need to do in order to push it up to EE 2.x.

    The code is:

    {exp:weblog:entries limit='1' rdf='off' disable='category_fields|member_data|pagination|trackbacks'}
    <meta name="keywords" content="{meta_keywords}" />
    <meta name="description" content="{meta_description}" />
    {/exp:weblog:entries}

    Unfortunately, I can’t post a link to the site at the moment because It’s for a new Charity who don’t want to disclose any information until they’re up and running.

    It’s currently outputting the information as follows:

    <meta name="keywords" content="" />
    <meta name="description" content="" />

    However, it’s only pulling in the content=“CONTENT HERE” > section from the latest entry, it’s not reading from the page that we’re on.

    Kind Regards
    Lewis

  • #10 / Feb 01, 2011 2:40am

    John Henry Donovan

    12339 posts

    For EE2.x I changed weblog to channel and removed reference to trackbacks

    {exp:channel:entries limit='1'  disable='category_fields|member_data|pagination' channel="news" url_title="{segment_3}"}
    <meta name="keywords" content="{meta_keywords}" />
    <meta name="description" content="{meta_description}" />
    {/exp:channel:entries}

    Above you can see I added a channel= parameter. Switch ‘news’ for your own channel shortname. Also the url_title is taken from your actual URL.

    http://www.mysite.com/index.php/template_group/template/url_title

    The above URL has the url title at segment 3 hence the {segment_3} tag.

    Does that help?

  • #11 / Feb 01, 2011 6:05am

    LewisSellers

    14 posts

    Hi John,

    Thank you for your help.

    This once again ‘kind of’ works. The problem is, each page has a different Channel name, because I wanted the URL structure to be:

    http://www.mysite.com/page1
    http://www.mysite.com/page2
    and so on…

    Technically, your code works perfectly for the homepage, as that used a different embed for the header section, but on the internal pages, unfortunately it’s not working.

    I’ve now got the following code:

    {exp:channel:entries limit='1'  disable='category_fields|member_data|pagination' channel="{channel}" }
    <meta name="keywords" content="{meta_keywords}" />
    <meta name="description" content="{meta_description}" />
    {/exp:channel:entries}

    The idea with this was that the {channel} would dynamically change to the channel of the page being viewed. However, when I’ve got this code in, It doesn’t display anything, so my code doesn’t even show the start of the <meta name=“keywords” etc…

    If you’ve got any ideas why this won’t work, It’d be greatly appreciated.

    Expression Engines Meta system is causing headaches 😊

    Kind Regards
    Lewis

  • #12 / Feb 01, 2011 4:54pm

    Ingmar

    29245 posts

    The idea with this was that the {channel} would dynamically change to the channel of the page being viewed.

    Try using {segment_1} instead of channel, like so:

    {exp:channel:entries channel="{segment_1}" dynamic="no"}
  • #13 / Feb 01, 2011 7:13pm

    LewisSellers

    14 posts

    Hi Ingmar,

    Just tried this but it’s doing exactly the same thing… It’s pulling in the information of the latest document, but then if I go to other internal pages, it doesn’t even show the tags that are inside the {exp:channel:entries…. sections.

    I can't believe how difficult it is to do meta tags in EE. I'd have thought that putting in the {channel} would select the channel the page is picking from and grab the meta descriptions and keywords out of that.. Obviously not.

    Is it easier for me to just separate the header_int embed file into 9 separate files in order to have different meta titles on each page? It seems a bit sloppy but It’s taken quite a lot experienced uses to find a solution and it doesn’t seem to be easier :(

    Thanks for all your help, I really appreciate it. If you’ve got anymore ideas, please fire away! 😊

    Kind Regards
    Lewis

  • #14 / Feb 02, 2011 3:15pm

    Ingmar

    29245 posts

    Just tried this but it’s doing exactly the same thing… It’s pulling in the information of the latest document, but then if I go to other internal pages, it doesn’t even show the tags that are inside the {exp:channel:entries…. sections.

    Can you show us more of your template, perhaps a link to your site where this happens?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases