Announcement

Collapse
No announcement yet.

Upload individual design elements

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

    Upload individual design elements

    I'm needing a way to upload specific Actinic layouts as individual php files, for instance, pulling all the <head></head> Actinic information into an external file for use elsewhere (uploaded to the web server on each upload).

    I've tried a few things with PHP, none of which seemed to work, and was wondering if anyone has any pointers or ideas?
    Cheers

    David
    Located in Edinburgh UK

    http://twitter.com/mcfinster

    #2
    Could you do a text file containing the code and then call the text file contents via your php? Your php just reads the content of the text file in effect. You could add the text files to additional files so they were uploaded into acatalog and available to read.

    Comment


      #3
      Hey Lee!

      I'm needing more automated solution unfortunately, something that will parse the Actinic layout (so any changes are automatically reflected), save it to a file then upload it.

      I can create a txt file with PHP and put "hello" inside it no problem within Actinic but if you try and include a layout it fails. I'm guessing it may have something to do with PHP trying to parse the actinic tags but I could be way off. I'm not even sure when the layouts get parsed, even if successful creating a external file from them may just include the raw code and not the final parsed html!
      Cheers

      David
      Located in Edinburgh UK

      http://twitter.com/mcfinster

      Comment


        #4
        Gotcha, you need it parsed and then to get at it, hmm good question. Actinic parses on the desktop and adds the html file into siteHTML, these pages are then uploaded on a publish to web, so all parsing, blockifs, layouts, variables etc. are all done on the desktop, producing the finished html for upload.

        Only thing i can think of is to have a hidden or some hidden pages on the site, where the layouts have been parsed for you and then do some sort of scrape of the html off those pages. You could on those orphan pages strip the parsed html down to the absolute minimum that you require, so easier to get hold of. Perhaps with the scrape you can have something like a top and bottom marker whcih signify where the scrape is to occur and finish.

        Can you be more explicit with an example, the grey matter might think of something more logical and easier.

        Comment


          #5
          I did actually try to make an alternative Outer Layout but (and it's been ages since I opened Actinic) couldn't seem to get it to render for a separate brochure page (it just defaulted to the normal outer layout). Is this possible?
          Cheers

          David
          Located in Edinburgh UK

          http://twitter.com/mcfinster

          Comment


            #6
            Yeah what you'd need to do is think of it arse upwards. Create a new overall layout, register it with actinic, so the site started using that as the new site template, then in site options, you'd change them all back to the one before, so the registration of the design was basically to get it into actinic, you then reverse the design back to the original. On any page you create then on the layout tab you can choose the overall layout to use, so on your dummy pages, select your new overall layout.

            You might find it easier to just strip an actinic theme layout (web page outer layout in the design library) and then just select that as your overall layout on the dummy pages.

            Comment


              #7
              Baws, that won't work then, I potentially need to upload 2-3 different layouts.

              I'll have another look at the PHP side of things and see if there is anything I can come up with.
              Cheers

              David
              Located in Edinburgh UK

              http://twitter.com/mcfinster

              Comment


                #8
                Why not one page per layout?

                Comment


                  #9
                  AHA, I should never doubt my greatness! ;-)

                  This works:-

                  Code:
                  <actinic:block php="true" selectable="false" >
                  $myFile = "cc-header.php";
                  $fh = fopen($myFile, 'w') or die("can't open file");
                  fwrite($fh, '<actinic:variable name="TopContent" />');
                  fclose($fh);
                  </actinic:block>
                  
                  <actinic:block php="true" selectable="false" >
                  $myFile = "cc-footer.php";
                  $fh = fopen($myFile, 'w') or die("can't open file");
                  fwrite($fh, '<actinic:variable name="BottomContent" />');
                  fclose($fh);
                  </actinic:block>
                  This has a load of uses (IMHO). For a start, true Wordpress integration! So long as you code your layouts appropriately of course!
                  Cheers

                  David
                  Located in Edinburgh UK

                  http://twitter.com/mcfinster

                  Comment


                    #10
                    Actinic can also do this. In the Library, create a new Layout Type of type Popup. Layouts you create in there will write a file (like the Extended Info layouts do). You tweak the filename within the Edit Layout Details field.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      If you go with the PHP file write method (which I've used successfully). You have to watch out for special characters in your data. E.g.
                      Code:
                      fwrite($fh, '<actinic:variable name="TopContent" />');
                      will fail if TopContent contains a ' character.

                      Use:
                      Code:
                      fwrite($fh, '<actinic:variable name="TopContent" encoding="perl" selectable="false" />');
                      Or even better:
                      Code:
                      $html = <<<ENDOFACTINIC
                      <actinic:variable name="TopContent" />
                      ENDOFACTINIC;
                      fwrite($fh, $html);
                      Norman - www.drillpine.biz
                      Edinburgh, U K / Bitez, Turkey

                      Comment


                        #12
                        Originally posted by NormanRouxel View Post
                        Actinic can also do this. In the Library, create a new Layout Type of type Popup. Layouts you create in there will write a file (like the Extended Info layouts do). You tweak the filename within the Edit Layout Details field.
                        Norman,

                        Thanks for the reply. This looks like the perfect solution but I can't seem to get it to upload the file! Have given the layout a filename in the Extended Info Page File Name field, is this correct?
                        Cheers

                        David
                        Located in Edinburgh UK

                        http://twitter.com/mcfinster

                        Comment

                        Working...
                        X