1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I edit templates with an external editor

Discussion in 'XenForo Questions and Support' started by Rockchurch, Apr 24, 2012.

  1. Rockchurch

    Rockchurch New Member

    I'm looking to be able to edit my style's templates, specifically, but not exclusively the css templates in an external editor.

    I don't see these located in the style directory on the server, so I'm assuming that it's all stored in the db.

    Is there any way to edit these templates without manually copy-pasting from the template editor interface in the admin section? Is there a way to have my custom css at least in a flat-file on the server?

    I understand that it's possible to enable debug mode and connect via WebDav, but are there other any other options that don't include running in debug mode?

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  3. Rockchurch

    Rockchurch New Member

    Wow, what an ordeal. Enough that I'm discouraged, which I suspect is the general preference toward using external editors...

    I'd suggest adding one step to that post about WebDav. You may have to uncomment the magic 'allow webdav' line in .htaccess. I had to figure that one out for myself. You also may want to make those instructions more high-profile, as I searched for quite a while yesterday, before resorting to posting here looking for help. Had I found that post on page 2 of "Random Questions", I'd have gotten to where I am now yesterday.

    Also, when using CyberDuck, I can connect and browse, but I'm running into ISEs just trying to open one of the css templates, similar to what TrevC describes here: http://xenforo.com/community/threads/save-via-webdav-triggers-500-internal-server-error.13086/

    Since I can't actually open a bloody file using the recommended steps in that post (plus the secret .htaccess step), I've switched to connecting via the Finder, then opening the files in my external editor (BBEdit). Though, with TrevC's reports of saving a file via transmit corrupting all files, I am not exactly comfortable with this.

    Edit: Hang it all, the Finder's webdav connection isn't responsive. I give up on WebDav.

    Please, please consider an option or any method to somehow edit these files via the file system, whether it's only in a debug mode or what-have-you. Everybody understands the benefits of storing all this in the database, but it seems to be a regular stumbling block, a large-type speedbump in the workflow for the people trying to actually develop and maintain their XF implementations.

  4. mrGTB

    mrGTB Well-Known Member

    Why not just copy the code into your own Text Editor, make changes then paste it back again. At least doing it that way you can do a few paste in your Text Editor to have an original you can fall back on to paste if things go wrong. That's what I generally do when making template changes on my Tumblr Blog. I will paste 3 copies, but only work with one of them, leaving 2 originals to fall back on should I need be.


    Might seem like hard work, but it can be a life saver at times.
  5. Rockchurch

    Rockchurch New Member

    You'll note from my original post, that that is what I've been doing. It works passably, but it's a PITA.

    Copy-pasting is obviously a bit of an absurd 'workflow' (if one can even call it that).

Share This Page