We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26182
    • 164 Posts
    Hi there,

    I was wondering if it’s possible to associate an image with a news article ie having an upload form in the template for the user to upload an image that is associated with a news story?

    Thanks in advance,

    Sarah
      • 26182
      • 164 Posts
      Thank you for that.

      I’ve made a TV called ArticleImage.

      I want the user to be able to upload a file from their desktop to be associated with the news article.

      Do I need a file TV? I made one called ArticleAttach.

      How do I put this in my template for the form the user uses to post news articles?

      How do I output this image with the news article when the article is viewed?

      Any help would be great!

      :) Sarah
        • 26182
        • 164 Posts
        Hi Ganesh,

        This is what I have for my chunk and it still isn’t working.

        <div id="blogForm">
        <form name="NewsPublisher" method="post" action="[~[*id*]~]">
        <fieldset>
        <h3>Publishing Details</h3>
        <input name="NewsPublisherForm" type="hidden" value="on" />
        <label for="pagetitle">Page title <abbr title="The title used on the browser window">?</abbr>: <input name="pagetitle" id="pagetitle" type="text" size="40" value="[+pagetitle+]" /></label>
        <label for="longtitle">Headline <abbr title="The title used on the article">?</abbr>: <input name="longtitle" id="longtitle" type="text" size="40" value="[+longtitle+]" /></label>
        </fieldset>
        <fieldset>
        <h3>The Content</h3>
        <p>The Summary field is optional, but is used as a short version for RSS feeds and summary views on the main article page.</p>
        <label for="introtext">Summary (optional, but encouraged):<br><textarea name="introtext" cols="50" rows="5">[+introtext+]</textarea></label>
        <label for="content">Content:[*blogContent*][+content+]</label>
        </fieldset>
        <fieldset>
        [*ArticleImage*]
        <!--p>[[tagLinks?  &id=`[+id+]` &tv=`tags` &separator=`, ` &label=`Tags: `]]</p -->
        
        <h3>You're Done</h3>
        <input name="send" type="submit" value="Post it!" class="button" />
        </fieldset>
        </form>
        </div> 


        Thanks so much for your help.

        Sarah
          • 26182
          • 164 Posts
          what snippet did you use?