Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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
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
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 astest.js
to/from the disk. - the right content type (e.g.
application/javascript
) whentest.js
is called viacss.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, savingtest.js
astest.js.css
. - hence no tag atm.
I will wait a little for your comments and commit for testing. The revert is easy anyway.
Offline
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
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
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
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
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
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