Foren / Cotonti / Support / A little extended pagetextbyid

Dayver
#40852 30. April 2015, 21:57
#40851 staleo:

But let me little extend the plugin's possible implementation. How about if I make a new global, like, {PAGE_TO_FETCH_FROM}. While editing a page, I input an other's page id into it, and a first page comes up with some of the fetched thing from the second page.

In terms of pagefieldbypid from you, Dayver, the global tag must be sort of {PHP|pagefieldbypid({PAGE_TO_FETCH_FROM}, 'text')} which of course doesn't work. How to make it go fine?

update:

Oops, pagefieldbypid seems to work a little unstable. First, I added a global tag {PHP|pagefieldbypid(518, 'fakel_name')} in a footer.tpl just to make sure it's fine. It was fine. Than, I added the same tag into a page.tpl, and the both places tag output nothing! Hmmm.

Try instead {PHP|pagefieldbypid({PAGE_TO_FETCH_FROM}, 'text')} put {PAGE_TO_FETCH_FROM|pagefieldbypid($this, 'text')}.

Strangely, I checked and in me one the same tag placed in different patterns worked everywhere and do only once request to the database because in this modification added caching.

Pavlo Tkachenko aka Dayver