Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#109 2018-08-09 03:52:02
Re: Testers needed: flat development (4.7+ only)
etc wrote #313358:
Yiannis, have you edited the plugin code? It comes with
$prefs['parse_css'] = false
, you need to set the preference totrue
.
Hi Oleg,
I did. The line reads $prefs['parse_css'] = true;
.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#110 2018-08-09 04:32:22
Re: Testers needed: flat development (4.7+ only)
In Admin>Preferences>Advanced I get this:
;css="text/css"
js="application/javascript"
json="application/json"
svg="image/svg+xml"
xml="application/xml"
txt="text/plain"
csv="text/csv"
htm="text/html"
html="text/html"
Is the semicolon before css
correct?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#111 2018-08-09 08:24:19
Re: Testers needed: flat development (4.7+ only)
colak wrote #313364:
The line reads
$prefs['parse_css'] = true;
.
Then I guess you are using the flat file? This will not work, flat files are served as they are directly from the disk, without even starting txp (whence the speed). You should use the db version:
<txp:css name="sitemap" type="xml" />
colak wrote #313365:
In Admin>Preferences>Advanced I get this:
;css="text/css"...
Is the semicolon before
css
correct?
Yes, css
is the mimetype by default as long as we use Styles
pane. If we switch to a new place (assets, resources, whatever), this line will be uncommented.
Offline
#112 2018-08-09 10:37:31
Re: Testers needed: flat development (4.7+ only)
etc wrote #313359:
Hi Julian, IIRC,
rah|oui_flat
have hooks that sync fs changes with db automatically (can’t imagine another way without too much code rewriting). That’s handy, but can be problematic if you develop a flat version (which you are the only one to see in 4.7, others are served from db) and make an error. If fs is synced with db then this error will be exposed to the whole world.
I agree with you and am not advocating that etc_flat should constantly sync with the db like rah_/oui_flat do.
What I mean is that etc_flat covers modifying existing page templates and forms just fine but doesn’t see new page templates / forms created in the flat files until you sync with the database.
Take the following development situation:
You create a new page template (or copy and modify an existing page template) in your flat files and now want to test it out on a section of your site. You can’t select it on the Presentation › Pages panel until you have synced your flat files with the online database.
It’s not a big problem, but for those who don’t know, it might appear like it doesn’t work. Perhaps it only needs mentioning in some future docs.
I generally work on a test site locally so I’m not worried about code I’m testing being visible on the front end because I’m not working on a live site. I’m not sure if this “you must sync to use” has implications for working on a live site.
TXP Builders – finely-crafted code, design and txp
Offline
#113 2018-08-09 10:51:47
Re: Testers needed: flat development (4.7+ only)
etc wrote #313366:
Then I guess you are using the flat file? This will not work, flat files are served as they are directly from the disk, without even starting txp (whence the speed). You should use the db version:
<txp:css name="sitemap" type="xml" />...
Hi Oleg,
Just reporting my tests
This returns www.neme.org/css.php?n=sitemap&t=neme960&e=xml
. Visiting that url and www.neme.org/css.php?n=sitemap
nothing is returned.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#114 2018-08-09 11:26:07
Re: Testers needed: flat development (4.7+ only)
With &
instead of &
it works: www.neme.org/css.php?n=sitemap&t=neme960&e=xml. And &
is not a problem in href
or src
.
Offline
#115 2018-08-09 12:32:33
Re: Testers needed: flat development (4.7+ only)
jakob wrote #313369:
What I mean is that etc_flat covers modifying existing page templates and forms just fine but doesn’t see new page templates / forms created in the flat files until you sync with the database.
I understand your concern, but one of the benefits of the flat dev is the possibility to work on a live site without exposing eventual errors to the world. A logged in dev is served the disk version in progress, while all the others see the stable db version. Once the flat version is ready, you import it to db for everyone’s eyes.
Now take the following development situation:
You create a new page template (or copy and modify an existing page template) in your flat files and now want to test it out on a section of your site. You select it on the Presentation › Pages panel (assuming txp allows it).
What page are your visitors seeing meanwhile? It is not in db, so they are lost.
Moreover, txp has no control on fs manipulations, so you can inadvertently delete a flat page/css associated to some section.
I generally work on a test site locally so I’m not worried about code I’m testing being visible on the front end because I’m not working on a live site. I’m not sure if this “you must sync to use” has implications for working on a live site.
We could introduce a “local flat dev” mode like this, but it’s not a little plugins territory. Too much code rewriting would be involved, I’m afraid, unless we adopt hooks à la rah|oui_flat
. This said, all ideas are worth consideration.
Offline
#116 2018-08-09 13:02:30
Re: Testers needed: flat development (4.7+ only)
etc wrote #313372:
With
&
instead of&
it works: www.neme.org/css.php?n=sitemap&t=neme960&e=xml. And&
is not a problem inhref
orsrc
.
Indeed it does!!! This is wonderful! I’ll wait until txp 7.1 where I hope that the url will become /assets.php?n=sitemap&t=neme960&e=xml
before I start using it.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#117 2018-09-07 17:45:08
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: Testers needed: flat development (4.7+ only)
colak, how you did sitemap.xml? Tell, please.
rah sitemap 1.2 does not work for ТХР 4.7.1
rah_sitemap 1.3 does not work correctly for ТХР 4.7.1 (here)
P.S.
Textpattern develops. Plugins become obsolete.
Sitemap is an important function for cms, should be added to the basic version. I think so.
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
#118 2018-09-07 18:10:55
Re: Testers needed: flat development (4.7+ only)
singaz wrote #313907:
colak, how you did sitemap.xml? Tell, please.
You can create your using txp’s own tags.
Make a page template and call it something like sitemap
. Then use txp:header to set the correct mime type and txp’s own various tags, like section_list, category_list and article_custom tags to output the xml structure of the sitemap. It’s not as point-and-click as rah_sitemap but it is very flexible.
Example:
<txp:header value="application/xml; charset=utf-8" /><?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<txp:section_list break="" exclude="sections,to,exclude">
<url>
<loc><txp:section url="1" /></loc>
<txp:evaluate test="article_custom">
<lastmod><txp:article_custom section='<txp:section />' limit="1" sort="LastMod desc"><txp:modified format="%Y-%m-%d" /></txp:article_custom></lastmod>
</txp:evaluate>
</url>
</txp:section_list>
<txp:article_custom section="sections,with,articles" limit="9999">
<url>
<loc><txp:permlink /></loc>
<lastmod><txp:modified format="%Y-%m-%d" /></lastmod>
</url>
</txp:article_custom>
<txp:category_list exclude="categories, to,exclude" break="">
<url>
<loc><txp:category url="1" /></loc>
</url>
</txp:category_list>
</urlset>
and then add a line near the top of the <IfModule mod_rewrite.c>
block your htaccess file with:
# sitemap rewrite
RewriteRule ^sitemap.xml$ index.php?s=sitemap [L]
Your sitemap will then always be available at www.yourdomain.com/sitemap.xml and will be updated when you add new categories, sections or articles.
TXP Builders – finely-crafted code, design and txp
Offline
#119 2018-09-07 18:46:39
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: Testers needed: flat development (4.7+ only)
jakob, thanks.
I will try.
I will report back.
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
#120 2018-09-08 06:57:01
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: Testers needed: flat development (4.7+ only)
I test your sitemap generator, jakob, and I get this error :
Line number 2, Column 1:
<? Xml version = "1.0" encoding = "UTF-8"?>
^
because the first line of xml is blank.
We must create the sitemap section too ?
Offline