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.

custom form field works on one page, not another

December 04, 2009 1:34pm

Subscribe [4]
  • #1 / Dec 04, 2009 1:34pm

    fifteen

    108 posts

    Within an include that gets called from all the pages on my site is this piece of code:

    {exp:weblog:entries weblog="landingpage" limit="1"}
    <a class="logo">{exp:imgsizer:size src="{landinglogo}" height="70" quality="100"}{sized}{/exp:imgsizer:size}</a>
    {/exp:weblog:entries}

    This code works perfectly on home but on subpages the {landinglogo} does not display. I have also tried it without the imagesizer code:

    {exp:weblog:entries weblog="landingpage" limit="1"}
    {landinglogo}
    {/exp:weblog:entries}

    And again on subpages only I cannot even get it to display what should be the full path to the image with the image name at the end. This had been working up until a few weeks ago (when I checked on it), but now it’s not. I’ve cleared my browser and EE caches, I haven’t moved servers and I know it has some ambition to work given it works on Home/Index but not Subpage/Index.

    Now, here’s the rub:

    My home url is http://www.domain.com/index/home/COMPANYNAME/ where COMPANYNAME is the title of any entry in our LANDINGPAGE weblog, which also gets an image uploaded to another custom field within that form. When COMPANYNAME is changed in the URL, the logo on the page changes to that company’s logo. For sub pages this url is somewhat longer, as in: http://www.domain.com/index/get_the_facts/this_is_the_page/COMPANYNAME/.

    I have the feeling I’m probably doing something wrong here but I swear I had it working a few weeks ago! The only other thing I can think of is I did add an entry to that weblog then deleted it. Perhaps this threw something off?

  • #2 / Dec 04, 2009 1:40pm

    Sue Crocker

    26054 posts

    What does landinglogo evaluate to?

    What kind of custom field are you using?

  • #3 / Dec 04, 2009 2:26pm

    fifteen

    108 posts

    Hi Sue,

    I’m not sure what you mean by evaluate to. Could you clarify as I’ve never heard that term used in conjunction with EE before!

    The custom field isn’t set to have any formatting and I’m simply uploading the image to that field without any formatting, i.e. https://ellislab.com/asset/images/team-photo/image.jpg

    Andy

  • #4 / Dec 04, 2009 3:34pm

    Greg Salt

    3988 posts

    Hi Andy,

    If you view the source of the rendered pages where the image does not display is anything output at all where the image should be?

    Cheers

    Greg

  • #5 / Dec 04, 2009 3:51pm

    fifteen

    108 posts

    I can confirm that nothing is being rendered.

  • #6 / Dec 04, 2009 4:07pm

    Adam Dorsey

    1439 posts

    Hi Andy-
    A few questions:

    1) Is “index” the name of your main template group? Or the index.php page?
    2) This will be answered with the first question… But are you using .htaccess to remove the index.php file?

    Also, can you do a reduction test?

    Try creating a “test” template, and use just this code:

    {exp:weblog:entries weblog="landingpage" limit="1"}
    {landinglogo}
    {/exp:weblog:entries}

    Remember to pass a url_title in to the test template when viewing, something like:

    <a href="http://www.domain.com/index.php/test/COMPANYNAME/">http://www.domain.com/index.php/test/COMPANYNAME/</a>

    Thanks!

  • #7 / Dec 04, 2009 4:40pm

    fifteen

    108 posts

    Hi Adam,

    No, index is the name of my php page, home is the template group.

    The test works.

    Andy

  • #8 / Dec 04, 2009 5:31pm

    Greg Salt

    3988 posts

    Hi Andy,

    Can I just confirm something? You said:

    My home url is http://www.domain.com/index/home/COMPANYNAME/ where COMPANYNAME is the title of any entry in our LANDINGPAGE weblog, which also gets an image uploaded to another custom field within that form. When COMPANYNAME is changed in the URL, the logo on the page changes to that company’s logo. For sub pages this url is somewhat longer, as in: http://www.domain.com/index/get_the_facts/this_is_the_page/COMPANYNAME/.

    Should the second link you mentioned actually be

    <a href="http://www.domain.com/index.php/home/get_the_facts/this_is_the_page/COMPANYNAME/">http://www.domain.com/index.php/home/get_the_facts/this_is_the_page/COMPANYNAME/</a>

    Does it work you go to that URL?

    Cheers

    Greg

  • #9 / Dec 04, 2009 6:30pm

    fifteen

    108 posts

    No it doesn’t work as the .php breaks the url in lieu of my htaccess settings.

  • #10 / Dec 04, 2009 7:16pm

    Adam Dorsey

    1439 posts

    Since the test works. This leads me to believe something else may be in conflict on the page.

    But, could you try disabling the .htaccess file for a quick test? Rename it to something like .htaccess-OLD. Then use the url Greg suggested.

    This will help us rule out url_rewrite problems.

  • #11 / Dec 04, 2009 9:54pm

    Adam Dorsey

    1439 posts

    Also, can you try outputting something simple, like the {title} in your problematic template? Are you getting any output at all?

  • #12 / Dec 04, 2009 10:00pm

    fifteen

    108 posts

    I am able to display an entire weblog entry on that page (from another weblog) with no problem at all. In the URL http://www.domain.com/index/get_the_facts/this_is_the_page/COMPANYNAME/ the “this_is_the_page” segment is actually the name of the weblog article. I think it’s appending the end of the URL with an additional weblog entry name “COMPANYNAME” is where I’m probably confusing EE.

  • #13 / Dec 05, 2009 1:33pm

    Greg Salt

    3988 posts

    Hi Andy,

    Do you have a link where we can see this?

    Cheers

    Greg

  • #14 / Dec 05, 2009 2:14pm

    fifteen

    108 posts

    Sure, keep in mind I’ve hardcoded the logo in the upper left to change based on segment_3 (as a band-aid) until I can get this fixed.

    http://coolltci.com/index/Get_the_Facts/how_much_does_long-term_care_cost/nada/

    If you change “nada” to “penfed” in the URL you’ll see the logo change.

  • #15 / Dec 05, 2009 3:03pm

    Greg Salt

    3988 posts

    Hi Andy,

    I’m afraid that I’m now a bit confused because the site seems to be working exactly as described that it should in your first post. What should be changed to demonstrate that your code will not work properly?

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases