how to insert URL?
  • In article I have a field "lapozhato" (single line text) where is the URL link like "www.../index.htm".

    I am using the following code:
    href="{{$gimme->article->lapozhato}}"

    but the result isn't what I need. I know that $gimme command returns the full current site path.

    Thank you!
  • 6 Comments sorted by
  • Dear Newscoop Support!

    Did I forget something? Or my problem is not clear enough? Or there is no solution? Or you don't know the answer?

    I will try to explain it again.

    I have 1 publication with weekly issues. In every issue there is one artice where is the date, the number, picture of cover AND a link to flip-page version of that issue.

    What command to use in template to get the link on html page?


    Thank you!
  • Dear Newscoop user,

    The solution you chose for displaying a link is very good. Create a new text
    field in the article type, e.g. "my_link". In the template engine you would
    write:
    <a href="{{ $gimme->article->my_link }}">

    This may cause a problem though when the field was empty. To make sure you
    display the link only when there's text in there use the following code:
    {{ if $campsite->article->my_link != "" }}
    <a href="{{ $gimme->article->my_link }}">
    {{ /if }}

    Mugur Rus
    Senior Software Developer, Sourcefabric
    mugur.rus@sourcefabric.org

    Cluj-Napoca, Romania
    +40 (0)720 528408
    Skype: mugur_rus

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric



    On Sat, Feb 19, 2011 at 4:00 PM, hhunor <
    newscoop-support@lists.sourcefabric.org> wrote:

    > Dear Newscoop Support!
    >
    > Did I forget something? Or my problem is not clear enough? Or there is no
    > solution? Or you don't know the answer?
    >
    > I will try to explain it again.
    >
    > I have 1 publication with weekly issues. In every issue there is one artice
    > where is the date, the number, picture of cover AND a link to flip-page
    > version of that issue.
    >
    > What command to use in template to get the link on html page?
    >
    >
    > Thank you!
    >

  • Hi:

    Actually the code should be:

    <p>{{ if $gimme->article->custom_field != "" }}
    <a href="{{ $gimme->article->custom_field }}">{{ $gimme->article->custom_field }}</a>
    {{ /if }}</p>



    right?

    Smile
  • Right Smile
  • Here I am again. The solution you gave to me is ok, but that is not what I need. I reread my first post and it is not decribing my problem clear. So I try it again.

    My web site is news.csaladikor.rs. In article there is single line text named "custom_field" with following contents: www.optimusns.com
    If I use <a href="{{ $gimme->article->custom_field }}">link</a> my generated link will be news.csaladikor.rs/www.optimusns.com. But I want the link to be www.optimusns.com. And it must be "dinamic", because I have an article with advert picture with link to that site.

    I hope that my problem is more understandable now. :) Thank you!
  • I find the solution!

    You just need to add http:// in front of {{ $gimme->article->custom_field }}

    <a href="http://{{ $gimme->article->custom_field }}">

    Thx