Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2018-04-13 06:14:11

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Testers needed: flat development (4.7+ only)

Assets works as a name for me, what is the general consensus? I can put a Twitter vote together if you give me the words.

Offline

#62 2018-04-13 06:17:04

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Testers needed: flat development (4.7+ only)

Also, how does this affect themes? We import/export styles at the moment. If we moved to assets would that house all mime types in a single directory or have further subdirectories?

Offline

#63 2018-04-13 06:22:28

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

Re: Testers needed: flat development (4.7+ only)

txp:asset looks good to me in English and for the tag but if we are to use it in the pane, the translation to Greek is problematic as the Greek word only refers to financial assets. I don’t know what the other translators think.

For the pane Types, mentioned earlier, should translate well in most languages I think.


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

Offline

#64 2018-04-13 06:29:16

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Testers needed: flat development (4.7+ only)

txp:asset as a tag sound OK (short to type), but I agree with Colak above, it is problematic once translated. I earlier suggested “Resources”, but “Types” might be acceptable although not as clear (to me at least) and a bit geeky.

philwareham wrote #310980:

Also, how does this affect themes? We import/export styles at the moment. If we moved to assets would that house all mime types in a single directory or have further subdirectories?

I’d hope one folder -:)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#65 2018-04-13 06:59:03

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Testers needed: flat development (4.7+ only)

Just throwing this out there…

  • txp:thing / txp:flat_thing<txp:thing type="js" name="my-js-thang" />
  • txp:item / txp:flat_item<txp:item type="css" name="my-css-item" />
  • txp:format / txp:flat_format<txp:format type="xxx" name="my-naughty-format" />

And later:

  • <flat::format type="js" name="my-js-thang" />
  • etc.

I’ve no idea what I’m talking about

Offline

#66 2018-04-13 15:53:11

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

Re: Testers needed: flat development (4.7+ only)

Well, after a struggle against Skin package, I’ve got

  • something working: db/file versions sync that preserves the eligible extensions, so test.js “stylesheet” is exported/imported as test.js to/from the disk.
  • the right content type (e.g. application/javascript) when test.js is called via css.php. You can also use directly the flat version: <script src=".../styles/test.js"></script>.
  • a gut feeling that for backwards compatibility we need another table/directory for assets. For example, rvm_css will not work well, saving test.js as test.js.css.
  • hence no tag atm.

I will wait a little for your comments and commit for testing. The revert is easy anyway.

Offline

#67 2018-04-13 16:23:13

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

Re: Testers needed: flat development (4.7+ only)

Hi etc. So to test this all I need to do is replace the css.php file?

where from?


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

Offline

#68 2018-04-13 17:10:03

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

Re: Testers needed: flat development (4.7+ only)

Hi Yiannis,

either download the latest dev or wait few hours until Pete’s demo site grabs the latest version.

To test, create a style called test.js with alert('Hello, Yiannis!') inside and export the theme to the disk. If everything is fine, it should be saved as test.js (without .css extension) and you can call it both as

<script src="<txp:site_url />css.php?n=test&e=js"></script>
<!-- and -->
<script src="<txp:page_url type="theme_path" />/styles/test.js"></script>

in some template.

Offline

#69 2018-04-15 13:31:55

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

Re: Testers needed: flat development (4.7+ only)

Another step on the flat surface: <txp:css /> can generate “flat” links with format="flat" or format="flat.link". It also accepts type attribute (acceptable values are txt, csv, htm, html, js, json, xml, svg atm).

For example, create a style test.svg:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <path d="M30,1h40l29,29v40l-29,29h-40l-29-29v-40z" stroke="#000" fill="none"/> 
  <path d="M31,3h38l28,28v38l-28,28h-38l-28-28v-38z" fill="#a23"/> 
  <text x="50" y="68" font-size="48" fill="#FFF" text-anchor="middle"><![CDATA[410]]></text>
</svg>

Now you can generate an URL pointing to this image: <txp:css name="test" type="svg" />, served as image/svg+xml. You can also directly output the image (as src attribute of an <img /> tag):

<txp:css name="test" type="svg" format="link" />

If you export the theme to the disk, you can also use the flat version:

<txp:css name="test" type="svg" format="flat.link" />

I’m still unsure about the type attribute of <txp:css />. It could be detected automatically from the extension, but name can be a list like test.xml, test.svg, in which case the type to use is unclear.

Enjoy and feed back to me!

Offline

#70 2018-04-16 11:37:09

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Re: Testers needed: flat development (4.7+ only)

Hi Oleg ;)

Pretty cool and so fun, too!
Do you project to rename this css.php file (into asset.php for example) and/or the <txp:css /> tag itself now that it can handle all kind of text file content?


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#71 2018-04-16 12:05:11

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

Re: Testers needed: flat development (4.7+ only)

Hi Patrick, thanks!

Pat64 wrote #311064:

Do you project to rename this css.php file (into asset.php for example) and/or the <txp:css /> tag itself now that it can handle all kind of text file content?

Rename we can not (the backwards compatibility…), but a new name would be fine and easier to manage. But this requires a new Assets pane, new strings, some extra coding/testing, hence extra time. So consider this flat functionality as experimental atm and don’t rely on it in production.

Offline

#72 2018-04-16 12:51:50

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

Re: Testers needed: flat development (4.7+ only)

Hi Oleg,

I am testing this and works wonderfully. I can fully understand the problem re big changes for now. Hopefully the semantics of the functionality will be included in 4.8.


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

Offline

Board footer

Powered by FluxBB