Announcement

Collapse
No announcement yet.

including a file

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

    including a file

    hi, can someone point me in the direction or give me the code to include a html file in actinic layouts. I want the user t be able to update this file, which needs to show in each store page.

    Can find a reference to php includes in Advanced guide..do I need to use this?
    Web design Bradford

    #2
    "php include" should bring up previous discussions on this. Best to use that method to include the contents of a text file i suspect although we're guessing somewhat with minimal info provided on what's going to be changed, variables might be just as easy.

    Comment


      #3
      thanks for the reply lee, sorry if its too brief.

      I have a file called sideimages.html

      The client needs to be able to update this using dreamweaver or notepad and resave it into the actinic directory. In the layout of the store I need this file to be included across all pages.

      If there is a variable instead of using php could you let me know what I would need to put?

      TIA
      Web design Bradford

      Comment


        #4
        What are they changing in that file though? just image names? boat loads of html? etc. What they need to change (to what extent) will decide what is your best course of action. From what what you've said so far, i suspect you should have a brand new layout in the design library, add this into the design and have variables in place to change things such as the images used (if that's what you are trying to provide).

        Comment


          #5
          Just three lines of code...

          <a href="http://www.domain.com" title="blah"><img src="1.jpg" alt="blah" class="rightlinks" /></a>
          <a href="http://www.domain.com" title="CAD News"><img src="2.jpg" alt="blah" class="rightlinks" /></a>
          <a href="http://www.domain.com" title="blah"><img src="3.jpg" alt="blah" class="rightlinks" /></a>

          So they will save new versions of the jpgs (to replace the others) then change the links in the include file....nothing fancy

          Tried <!--#include file="sideimages.html" -->
          Web design Bradford

          Comment


            #6
            If the image name will always be the same, then i'd just setup 3 variables for them to fill out the target URL. The rest i'd have as a layout already in there that just reads the contents of the 3 new variables. Includes is not needed for that.

            Comment


              #7
              If you put the following snippet of code into a layout it will do what you want. Keep sideimages.html in your Site folder.
              Code:
              <actinic:block php="true">
              	if ( file_exists('sideimages.html') )
              		{
              		echo file_get_contents('sideimages.html');
              		}
              </actinic:block>
              You could also replace sideimages.html with an Variable of type Filename and thus be able to include a different file on each page.

              FOOTNOTE: Just saw Louise's post and it's a cleaner way to go.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                thanks all, very helpful as always.

                @Norman FOOTNOTE: This is one of the rare things that was easier to do in V7 and before.

                I agree! I thought it was a lot easier the last time I did it.
                Web design Bradford

                Comment


                  #9
                  Originally posted by DarrenSpink View Post
                  @Norman FOOTNOTE: This is one of the rare things that was easier to do in V7 and before.
                  I amended that FOOTNOTE as I was wrong. I thought that File Content was unavailable in V9 but Louise pointed it out in the drop-down list of types.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    I use
                    Code:
                    !!<
                    <actinic:block php="true">
                    include('http://www.domain.co.uk/acatalog/file.txt');
                    
                    </actinic:block>
                    >!!
                    code is in a fragment rahterthan a layout

                    Comment

                    Working...
                    X