PHP Make Mark-Up Page

Hi guys,

after having had no reaction for my word-press action dev at all, I now try to understand actions in total (which I don’t but that’s just because I’m an idiot).

Had a look into the PHP Make Markup Page-action and after investigating the code I thought this could be the no 1 choice for my basic needs:

A pure blank nothing page or as in the action described:

Makes a Pure Mark-Up Page!

I see some functions like:

removeDoctype() and stuff which would fit into my needs (theoretically) but honestly it doesn’t work the expected way. It still keeps the doctype.

Cryptic description? - I know but all I want is to have a clean php page with the opportunity of adding custom mark-up.

Thanks in advance for any pointers.

Cheers

Thomas


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There are a few Actions in this area. Let me walk you through them and what they’re meant for:

  1. PHP Make Insert Page (PMIP to its friends): This chops the head and feet off of a page, leaving you with only the content of the PageDiv. This is useful for creating the central template for a page, as in Wordpress. There are options to preserve the head elements (scripts, etc.) when this process runs. I believe there is an option to “scope” any IDs with the page filename, so as to avoid naming conflicts. Note that this last part is most likely going to break any layout that is not using inline style declarations (Freeway 6, or Freeway 5 with some Actions), because that ID change won’t percolate out to the CSS-making process in time, I don’t think.

  2. PHP Make Markup Page: This is kind of the opposite of the above. Instead of preserving the PageDiv, it preserves whatever you may have added through the Page / HTML Markup / Before HTML slot. Everything else is deleted. This is only useful if you like coding in Freeway’s editor dialog, and want to ensure that your bit of PHP is published along with the rest of your site. There are better ways to do this.

  3. PHP Mark Up, PHP Include PHP Page, PHP External Markup: These could easily be merged into a single Action. What they do is provide either a way to (in order of names above): Type some PHP into a text field (other than the HTML Markup dialog), Use a page within the current document (probably treated with the PHP Make Markup Page or similar) as a blob of pure PHP code, or Use an external text file as a blob of pure PHP code. In all three cases, the resulting code extracted from the dialog or source file is injected into your finished PHP page. It’s pretty much the opposite of what you usually want for a template system – there, you’re trying to separate things out into individual separate concerns.

  4. PHP Use Include Pages: This is the one I probably used the most when I was building the Softpress site (two versions ago, in 2003-6). This creates a proper <php include( 'path/to/file.php' ); ?> reference in one page to allow you to compose a meta-template. You would use this to inject your library code into the top of each page in your site, maybe.

Most of these were written by Paul Dunning while he was working at Softpress, and I had only a tiny hand in any of them, even though I’m on the project at the Forge. I tended to add features I needed while I was using them, and didn’t have a hand in the overall planning of the Actions themselves.

Now in the Template Actions project, I have written all of these, and here’s what they’re good for:

  1. Anonymous is a simple Action to strip off the ID of an element so it can live inside a loop without generating invalid HTML.

  2. Classify allows you to move the ID to a classname attribute, as well as provide a custom classname. Also important for looped content.

  3. CrowBar allows you to make an inline markup item that does not have a surrounding

    tag, or to export a blob of markup outside of the current

    (or other text container) tag. This is useful for things where you need a particular HTML construction, like maybe this sort of thing: <div class="avatar"> ... </div><p>Person name</p>. Freeway, on its own, can only ever put the markup for the avatar within the current text container.

  4. Empty Box Helper gets rid of the nasty 1px font size on any empty HTML element. If you’re processing the page in a template system, and filling in content to that box later, you need this to avoid minuscule type content.

  5. TemplateHelper started out as a simple way to get certain font styles to appear in the current page, without having to make them as Tag-only Styles. The idea was that you would have a scratch element on the pasteboard somewhere, put instances of your various text styles that your template elements would need, and then when the page was published, that scratch element would be removed, but the text styles would still be put into the page head or stylesheet. This grew to include the ability to create “partials” – sub-page elements that could be composed programmatically, like maybe one row of a table that would be repeated over and over in PHP from a database lookup. TH is fairly inflexible about where it will place these partials – they always appear alongside the current page, and are always prefixed with an underscore (that’s a Rails tradition for partials). This Action suffers a bit from the global Freeway bug of renaming Action-published files at whim. I’ve added a warning that appears when this happens, since it’s usually deadly serious when a partial gets renamed – you would have to track those changes in your hand-written template code, and most people don’t want to do that, naturally.

Hope this helps,

Walter

On Mar 20, 2014, at 5:21 AM, Thomas Kimmich wrote:

Hi guys,

after having had no reaction for my word-press action dev at all, I now try to understand actions in total (which I don’t but that’s just because I’m an idiot).

Had a look into the PHP Make Markup Page-action and after investigating the code I thought this could be the no 1 choice for my basic needs:

A pure blank nothing page or as in the action described:

Makes a Pure Mark-Up Page!

I see some functions like:

removeDoctype() and stuff which would fit into my needs (theoretically) but honestly it doesn’t work the expected way. It still keeps the doctype.

Cryptic description? - I know but all I want is to have a clean php page with the opportunity of adding custom mark-up.

Thanks in advance for any pointers.

Cheers

Thomas


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,

thanks for clarifying - understood (the most).

What I am after is perhaps a clever combination of the PHP suite. To create a WordPress Page, it is necessary to remove ALL (HTML)Tags and leave the PHP part alone (cause they are included by the partials/parts such as header, content, footer.

This should look like:

Conclusion:

The Use include PHP would indeed cover the call of the created partials (php include).

But how to remove all TAGs first? Hmm

Cheers

Thomas


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Maybe a lil note as additional info here:

The basic wish was, to recreate the default WordPress files within Freeway (the first level files). This is simply not possible (suitable) using the php action-suite.

The problem is, that this first level requires the _partial-file resources (from the second level) at a time they are not yet created. It seems to be a question of “synchronization” during publishing.

This is a one the one hand a pity cause this disables us to write an entire “template” within Freeway, on the other hand reasonable - cause you can’t spent the money that you haven’t earned yet, perhaps.

Maybe I’ve also overlooked something.

Cheers

Thomas


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options