Announcement

Collapse
No announcement yet.

Using text files as product descriptions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using text files as product descriptions

    I was wondering if its possible to have the product descriptions stored as text files (there are thousands of them) and for Sellerdeck to 'echo' the contents of the files.

    Every product has its own txt file ( eg product ref 12345 has a text file called 12345.txt)

    Paul

    #2
    yes. Just create a customised template and include the files in actinics php. The text files will be pulled in on the desktop.

    Mike
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment


      #3
      Although this is possible I would be wary of the processing time (and memory requirements) of SD during the pre-upload phase. Have you considered importing them instead?

      Comment


        #4
        This is easy to do via a Variable of type File Content (but see the caveat at the bottom):

        Go to Design / Library / Variables.
        Right-click Product and choose New Variable.
        Set it up as per the attached screenshot.

        Then go to Design / Library / Layouts / <your product layout>
        Look for the line:
        Code:
        		<actinic:variable name="ProductDescription" />
        (may appear as ProductDescription)
        Immediately after it add:
        Code:
        		<actinic:variable name="DescriptionFile" />
        That's it. Your products will now have an entry on the General tab called DescriptionFile that you can set to the filenames you use.

        CAVEAT: Text entered this way won't be located via SD's built-in Search.
        Attached Files
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          If your text filenames are the same as the product reference then you could output the content of the text file to the page using some local php in the layout that automartically opens the relevant text file and inserts it into the layout.

          Comment


            #6
            Automatic code to include the file if it matches the product ref:
            Code:
            <actinic:block php="true">
            	if ( file_exists('<actinic:variable name="ProductID" encoding="perl" selectable="false" />.txt') )
            		{
            		$desc = file_get_contents('<actinic:variable name="ProductID" encoding="perl" selectable="false" />.txt');
            		$desc = str_replace("\n", "\n<br />", $desc);   // replace newlines with <br /> tags.
            		echo $desc;
            		}
            </actinic:block>
            Just put after ProductDescription as per my post above.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X