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 field entry" output render woes...

October 19, 2007 9:29pm

Subscribe [3]
  • #1 / Oct 19, 2007 9:29pm

    brubin

    6 posts

    hi folks,
    I’m not 100% sure if this topic belongs here,
    or whether it has been asked or been covered before,
    cause it’s kinda hard to explain.. i basically didn’t know what to google for, so i guess i’ll just go ahead and ask my question while putting my trust in the gods of forum moderation, which will eventually move me in the right spot.
    ...and might even have an answer to this (or a hint, or a pointer!)

    i have a custom entry field (type:“text”,format:“none”) which basically holds the title of my article. i’m building a bilingual site, hence the ‘country_code’-prefix.
    this is how i use it in my template:

    <span class="comment-headline">
        <a href="http://{title_permalink=mydemo/mypage}">{{country_code}_title}</a>
      </span>

    and this is how it renders as HTML:

    <span class="comment-headline">
        <a href="http://mysite.com/en/index.php/mydemo/mypage/my_article_name">this is my title!</a>
      </span>

    You might notice the additional p-tags, that I most certainly didnot put into the template, nor do i want them in the rendered HTML-output, so where or how can I gain insight in why these extra (superfluous, inappropriate) tags are put there? The ultimate goal is to rule this behaviour out, or at least gain some control over, since this isn’t the first time this has popped up…?

    thanx for any help
    s.

  • #2 / Oct 19, 2007 10:13pm

    allgood2

    427 posts

    Make sure formatting is set to none for the field. Go to the field, switch the format to XHTML save, go back switch to none, select yes when it asks to update all current records, then see if it works.

  • #3 / Oct 19, 2007 10:22pm

    brubin

    6 posts

    thanx for the fast reply, but that doesn’t do the trick…
    still formatting with the p-tag;
    I’d really like to find out where those come from…

  • #4 / Oct 19, 2007 10:45pm

    allgood2

    427 posts

    Did you do it for both fields?  Actually can you embed fields like that? Shouldn’t the code be:

    <span class="comment-headline">
        <a href="http://{title_permalink=mydemo/mypage}">{country_code}_{title}</a>
    </span>
  • #5 / Oct 19, 2007 11:07pm

    Boyink!

    5011 posts

    Was this content in the field before you switched the formatting to none?  If so, did you check the box at the bottom of the page so that EE updated all existing content to the new formatting option.

    Also - check the formatting on the field in the edit mode for this entry.  Maybe it got reset at entry-level.

  • #6 / Oct 20, 2007 7:42am

    brubin

    6 posts

    Was this content in the field before you switched the formatting to none?  If so, did you check the box at the bottom of the page so that EE updated all existing content to the new formatting option.

    after allgood2’s reply i double-checked (again!), just to be sure,  so the answer is: “yes, i did” and “no, it didn’t fix my problem

    Also - check the formatting on the field in the edit mode for this entry.  Maybe it got reset at entry-level.

    you mean…? - oh no, it’s just a single unformatted line, a headline, cause that’s what is is…

    i have come across this phenomenon in a similar way, but the formatting didn’t bug me as much at first, since it made my desperate efforts towards getting some grip on EE a lot easier:

    i have another custom entry field, which hold the full path to an ikon-image, that is to accompany the article.
    when rendered it gets wrapped in a proper img-tag, which at the time served me just right,
    BUT:
    I’d still like to know/find out who/what decides when to add extra tagging, and maybe why.

    it seems, this serves as precautionary measure to ensure output validity, maybe (maybe not)?

    I would like, -maybe as a feature request-, to be able to control these things as one already can with the formatting of uploaded images (refer to: CP Home-›Admin-›Weblog Administration-›File Upload Preferences-›Create New Upload Destination->Image Properties).

    what’s so great about EE is, that it creates clean xhtml, and you can seperate markup from content.
    it is great to be able to remove the “style=border:0”-part, cause that can be taken care trough CSS, while the “alt=”-element is quite useful as such.

    so, the quest goes on… anymore suggestions, please?
    s.

  • #7 / Oct 20, 2007 9:24am

    Boyink!

    5011 posts

    Allgoods comment on the formatting of your code is a good one - did you get that straightened out?

    What do you get if you do a simple template with just the weblog entries tag and {country_code}{title}?

  • #8 / Oct 20, 2007 9:26am

    allgood2

    427 posts

    It sounds like you are just missing a preference somewhere, really, when I set format to ‘none’ for a field, I never had EE output paragraph tags that I didn’t want. Typically, if I get tags I don’t want, its because, I didn’t set the field properly, I didn’t turn off auto-formatting of links, or something along those lines. Otherwise the only place where I experience control issues is with tags that auto-generate unordered lists.

    Did you try my suggestion about the field organization? I’m not certain if that would work, but it seems to me, if you use the embed field within a field method, you end up creating a third field for example

    {{country_code}_title}

      if your prefix was russian, then should produce the field {russian_title}, then that field would be processed. So the you would then have three fields that you require no formatting on: {country_code}, {title}, and {russian_title}  is this correct.

    Also, in terms of troubleshooting, have you tried creating a brand new field and testing what happens, as well as making sure there is no mark-up in the data of the field itself?

  • #9 / Oct 20, 2007 9:55am

    brubin

    6 posts

    okay, let me explain:

    this approach is taken from another forum-article.

    {{country_code}_title}

    actually works quite nicely in giving me the content in my custom field.
    i carry 2 fields - one is “en_title” and one is “de_title”
    and they could be filled with either “Good morning” or “Guten Morgen”, which makes great difference to my readers 😊

    {country_code}{title}

    on the other hand gives me a composite string of “country_code” + “title-of-my-article”,
    which is not what i want, an example of what that outputs would be: “en_my_new_article”.
    But - you’re both right: No additional tags get written in the output, and i am will ing to consider this ‘progress’, only it’s still “close, but no cigar…”

  • #10 / Oct 20, 2007 12:23pm

    allgood2

    427 posts

    Well then that should mean that the first two fields, {country_code} and {title} are correctly produce data without format. But the third field, which is a composite field {en_title} or {de_title} is adding formatting. I’m assuming you’ve already done so, but its worth mentioning again, did you check ALL three fields formatting options, and not just the final field or the first field?  Also did you check what happens if you create a brand new test field?  Additionally, what happens, if you don’t use the composite field {{country_code}_title}  but just place the final field {de_title} on the layout? Do you still get the paragraph tags?

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

ExpressionEngine News!

#eecms, #events, #releases