Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2018-12-28 09:50:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,439
Website GitHub

Re: flat scripts in 4.7.2

That’s all good stuff, colak.

I’m on board with all of that except the screenshots. I’m of the opinion that screenshots create a rod for our backs because they become out of date faster than words, and the type of users whom they serve (mainly newbies) who might feel comforted by their use then end up feeling uncomfortable because the screenshot doesn’t match the reality.

Let’s figure out how to structure the docs to add the kind of stuff you mention.

Last edited by Bloke (2018-12-28 16:52:46)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#17 2018-12-28 11:09:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,192
Website GitHub

Re: flat scripts in 4.7.2

colak wrote #315790:

What I would like to see developing is a user manual, presenting screen-shots of the installation process (starting with (s)ftp) to the use of tags when designing complex non blog and gallery sites. At the moment the vanilla front end template is excellent for blogs but it does not demonstrate the power and flexibility of txp as a CMS.

I agree wholeheartedly. I understand, too, that screenshots are hard to maintain but they are undoubtedly a great help for beginners. I know that when I look at other systems, screenshots help me get a handle on what to expect.

In general, I think we could split some of these things across the docs, tips and maybe even mag articles, as some are more examples than reference. Splitting things does, of course, add to the management requirement. There may be potential for a mag issue as quite a bit is new. I thought this might be a good txp-meet-up topic to discuss.

Migrating a site from another blog system to txp (wp, joomla, etc)

Without an import mechanism/format, this is, I think, very much a manual activity at the moment. The old importers worked while the other systems were still very basic. If you have access to the previous system and can control its output or massage its database, you can automate some of that. Building a site from an HTML template is, however, a relevant topic.

txp concept basics (this could be a basic tutorial linking to the tag reference)

I looked for this a few months back and even went as far as looking up Destry’s ‘seminal’ building-blocks articles on the way-back-machine. Things have changed a little since then, though.

A step by step tutorial on the multi-site functionality (admittedly I have not used this as I still have no idea about what to expect)

There are my multi-site installation instructions which must give you a pretty good idea and begin with “Why use a multi-site installation?”.

Creating plugins (there is some documentation on this but is it up to date?)

There are these which are, I believe, relatively up to date.

Creating short-codes (There are numerous examples in the forum which I could collect, collate and sanitise).

There are the docs and some examples in the docs, but I could also imagine examples being great as a category of the textpattern.tips site.

All the above (except the plugin creation) should be geared for designers and hobbyists as I believe that it is the userbase we need to target.

I also agree. The usage / getting started docs are for beginners, the rest should aimed at those with some knowledge of html and making websites.


TXP Builders – finely-crafted code, design and txp

Offline

#18 2018-12-28 16:42:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,439
Website GitHub

Re: flat scripts in 4.7.2

With regards screenshots (I was rushing when I wrote that, sorry) I should qualify that they should be used sparingly rather than as a matter of course. They do have value!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#19 2018-12-28 17:45:28

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,375
Website GitHub Mastodon Twitter

Re: flat scripts in 4.7.2

Sorry I did not respond. I wanted to read the links posted.

I still have many questions re docs.textpattern.com/installation/multi-site-textpattern. ie

the creation of subdomain

So, the multi-site install can not serve different domains? Further down the tutorial says we can, but this is slightly confusing.

the unpacked file tree to the web root on your webserver

If the above is correct, would the web root be the one where the www domain is served from?

If you chose a database prefix and are using one database for several Textpattern installations, remember to enter it during configuration.

Does this mean that we can have different site designs, sections, categories, url schemas, articles, images, content in general, using just one install?

Also what about migrating multiple sites to multisite administration?

There are the docs and some examples in the docs, but I could also imagine examples being great as a category of the textpattern.tips site.

I have created a short-tags category in the textpattern.tips site, waiting to be populated. I’ll start collecting first.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#20 2018-12-28 19:11:51

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,375
Website GitHub Mastodon Twitter

Re: flat scripts in 4.7.2

OK, I have created a short-tags category and written an article on the tips site (currently in drafts). One of the reasons I did not publish it is because textile does not seem to be parsing the tags starting with bc..

Julian, I understand you have publisher rights there, could you take a look?

This issue with textile seems to be appearing just for me and Stef:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#21 2018-12-29 09:33:34

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,192
Website GitHub

Re: flat scripts in 4.7.2

colak wrote #315803:

I still have many questions re docs.textpattern.com/installation/multi-site-textpattern. ie

Thanks for the feedback. I may go back and improve on it.

So, the multi-site install can not serve different domains? Further down the tutorial says we can, but this is slightly confusing.

Each site can be a different domain. It could also be a subdomain if you want it. The subdomain requirement refers to the admin and public sides: if they share the same domain, txp’s logged-in cookie works on the public and admin side together, which is useful for maintenance mode plugins or front-page edit links when logged in. So you could have the following structure:

/htdocs
    /sites
        /neme
            /admin      ->    admin.neme.org
            /private
            /public     ->    www.neme.org
        /neme-imca
            /admin      ->    admin.neme-imca.org
            /private
            /public     ->    www.neme-imca.org
        /neme-eventspace
            /admin      ->    eventadmin.neme.org
            /private
            /public     ->    eventspace.neme.org
        /statemachines
            /admin      ->    admin.statemachines.eu
            /private
            /public     ->    www.statemachines.eu
        /hblack
            /admin      ->    admin.hblack.net
            /private
            /public     ->    www.hblack.net
    /textpattern

If running multiple subdomains, as in the example with the eventspace subdomain, each admin area requires a separate subdomain, but you can name it how you like. I called it eventadmin. but you could also call it contributors. or manage. or whatever…

If the above is correct, would the web root be the one where the www domain is served from?

In this case I meant the folder on your host which is the base of your (theoretically) web-reachable folders. Many hosts call that www or htdocs with your account id-number. For a multi-site installation, you point your www.domain.com to the respective site’s public folder and the admin.domain.com to the respective site’s admin folder as in the example above.

Does this mean that we can have different site designs, sections, categories, url schemas, articles, images, content in general, using just one install?

Yes. Each site has its own admin area and own database (or database prefix) as before, but you have just one /textpattern folder with the files within it. The articles, images, links, categories are not all mixed up together in the same admin area.

Also what about migrating multiple sites to multisite administration?

There’s not an automated method, but it needn’t be complicated. Essentially, the /images, /files, /themes and any assets folders go into the /public folder, the config.php goes into the /private folder and if you’re using a plugin folder, put that in the /admin folder and adjust the paths accordingly in your site’s prefs. Likewise, the path in config.php needs adapting. Perhaps I should write another docs for that.

If you’re not averse to setting your own symlinks, you can theoretically also share content across multiple sites. When I was using rah_flat in the previous version of Textpattern, I had a /libs folder containing subfolders for sass modules, common javascript and also forms that were used in all the sites. That’s no longer quite as straightforward with the /themes folder.


TXP Builders – finely-crafted code, design and txp

Offline

#22 2018-12-29 11:41:33

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,192
Website GitHub

Re: flat scripts in 4.7.2

colak wrote #315806:

OK, I have created a short-tags category and written an article on the tips site (currently in drafts). One of the reasons I did not publish it is because textile does not seem to be parsing the tags starting with bc..

Julian, I understand you have publisher rights there, could you take a look?

This issue with textile seems to be appearing just for me and Stef:)

I checked your article and all you were missing was a space after bc... As a result it output the actual code on the next line (adding an audio element) instead of showing the code. I added a space and brought it up to the same line and it shows fine now.

BTW: the method

bc..{space}
txp
… txp code example …

that we can use in the forum doesn’t work in Textpattern itself and seems to be something specific to the forum.


TXP Builders – finely-crafted code, design and txp

Offline

#23 2018-12-29 14:12:08

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,375
Website GitHub Mastodon Twitter

Re: flat scripts in 4.7.2

!!! That was exactly what I needed to understand multi-site functionality. Thanks so much Julian… and also thanks re the tips. Of course I know about the spaces etc but it does not matter how much I was trying, the code would not render as a preformatted code.

Now… Back to the issue of the docs:)

Much of the new tag parser provides a lot of shortcuts which may not be very obvious. Up to 4.6.x, txp tags followed the xml type schema but since 4.7 and thanks to Oleg’s efforts, some of the syntax is not always fully understandable to designers. Further to example 8, I added to the docs a few weeks ago, and pointed out yesterday in this thread is based on Oleg’s forum post, makes no sense to me, but I know that it works. Like with the doc types or the new <header> functionalities, or even this very handy tip from Oleg (<txp:evaluate query='0<txp:variable name="no" />+1' />) which also works but I do not understand:)

Again, I am not complaining, I’m just excited by the possibilities and I’m trying to see how they can be made more accessible to designers.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#24 2018-12-29 18:58:39

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,252
Website Mastodon

Re: flat scripts in 4.7.2

i hope this is where i post this question. In the new year i am going to finally give TxP and editing Flat Files a go. So what do i need to download/install to get started?


…. texted postive

Offline

#25 2018-12-29 19:02:17

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,375
Website GitHub Mastodon Twitter

Re: flat scripts in 4.7.2

bici wrote #315831:

i hope this is where i post this question. In the new year i am going to finally give TxP and editing Flat Files a go. So what do i need to download/install to get started?

This is easy:) As from the latest version(s), you do not need to download anything. You could do everything on TextEdit on mac, PlainText on pc, or you could use an html editor of your choice. If there is one thing not installed in most computers but you most definitely have already is an ftp client:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#26 2018-12-29 21:47:06

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,192
Website GitHub

Re: flat scripts in 4.7.2

colak wrote #315832:

This is easy:) As from the latest version(s), you do not need to download anything.

But etc_flat can be helpful if you want to develop using flat files. The difference is:

  • regular situation:
    • your pages, forms and styles are stored as usual in the database, now grouped by theme. You can export these to disk to save them as files in the /themes folder.
    • you can edit the flat files on disk as well but it has no effect until you import the files from disk to the database.
  • with etc_flat:
    • When working in testing or debugging mode, textpattern fetches the flat files directly from the disk, by-passing the database.
    • When working in live mode, the database versions are used. To make the live version match your testing version, you need to import the theme from disk to the database.

So, etc_flat is not needed but helpful in practice when developing. Please correct me if I am mistaken.


TXP Builders – finely-crafted code, design and txp

Offline

#27 2019-02-01 13:46:31

ia278
Member
From: UK
Registered: 2018-11-07
Posts: 17
Website

Re: flat scripts in 4.7.2

etc wrote #315739:

that should be format

<txp:output_form form="jquery.js" format="flat.script" />...

I’m having a problem with this too…

So what I’ve done is create a generic form called myscript.js, and then called it using;

<txp:output_form form="myscript.js" format="script" mediatype="application/javascript" />

Is this correct? Because although the source code spits out a script tag with the required src, the actual link shows an empty page…

Last edited by ia278 (2019-02-01 14:49:23)

Offline

#28 2019-02-01 14:25:45

etc
Developer
Registered: 2010-11-11
Posts: 5,674
Website GitHub

Re: flat scripts in 4.7.2

ia278 wrote #316398:

To use this, you must create a custom js form type in Advanced options:

[js]
mediatype="application/javascript"

although the source code spits out a script tag with the required src, the actual link shows an empty page…

Then assign js type to myscript.js form and save it to disk (via Export to disk checkbox or Theme export). Then

<txp:output_form form="myscript.js" format="flat.script" />

should work. Or fetch the form from db with (mind .js extension)

<txp:output_form form="myscript.js" format="script" />

Or rename it to just myscript (without .js) and use your code (mediatype attribute is not needed).

Hope that helps.

Offline

#29 2019-02-01 15:06:32

ia278
Member
From: UK
Registered: 2018-11-07
Posts: 17
Website

Re: flat scripts in 4.7.2

You’ve definitely helped – I can see the root of the problem a bit better now! Thanks!

So, I’ve added [js] mediatype="application/javascript" title="JavaScript" to the advanced options (even though it’s the same as the stuff that comes by default, minus the ;?), and managed to get the database version working – but I don’t think the flat file version is?

I remember seeing this;

  • path/to/site/index.php?f=hello.js will serve the parsed db version
  • path/to/theme/forms/js/hello.js will serve the unparsed flat file version

I’m only getting the former. And I’ve not seen the Export to disk checkbox at all (which I assume I need to do to save the form as a flat file)…

Last edited by ia278 (2019-02-01 15:31:25)

Offline

#30 2019-02-01 15:56:34

etc
Developer
Registered: 2010-11-11
Posts: 5,674
Website GitHub

Re: flat scripts in 4.7.2

Fine, getting closer. Custom form types are in ini format, ; is just a comment. Have you ever exported your theme to disk? To be sure, go to Themes tab, select the current theme and try to export it. This should enable export checkbox for forms, pages and styles. Once hello.js is exported, you should be able to use its flat copy.

Offline

Board footer

Powered by FluxBB