[campsite-support] Subscrition
  • Dear guys

    am listing some news in my home page , there is an image inside the text

    i want to do a link for that image , but i need this link to be active only
    for logged in subsicribers

    any hint how to do that

    many thanks in advance and best regards




    --
    Alaa Anabtawi
  • 1 Comment sorted by
  • Hi Alaa,

    It would be some like this:

    {{ if $campsite->user->logged_in }}

    {{ /if }}
    ...
    {{ if $campsite->user->logged_in }}

    {{ /if }}


    humm... wait, I just noticed you said "inside the text". The example
    above works for an image in the document, attached to a given article
    but displayed out of the content text. If what you need is to do the
    same with an image which was inserted inside the article content text,
    sorry... it's not possible at the moment to do such thing.

    You can find workarounds anyway, like playing with article types...
    let's say... to have an article type with two content texts (for
    public and the other one for users), then you put the same text in
    each with the image. Then, in the content for users you just add the
    link to the image.

    Then, in your template, you code validations (like the one I wrote
    above). If the user is logged in, then your template shows the content
    text for users (whit the linked image), if not... then you show the
    content for public.

    It's not a neat solution, but I just said, definitely a workaround Smile

    Cheers,


    On Sun, Jan 10, 2010 at 11:25 AM, Alaa Anabtawi wrote:
    > Dear guys
    >
    > am listing some news in my home page , there is an image inside the text
    >
    > i want to do a link for that image , but i need this link to be active only
    > for logged in