-
Posts
533 -
Joined
-
Last visited
Everything posted by adrianmak
-
Do you mind post the code for preventing "double submission"? Is it save to show a session id in the form even it is a hidden field ?
-
-
is it possible to show a field on a specific page id() ?
adrianmak replied to adrianmak's topic in General Support
I knew this field setting. But I just knew I could use id to control a field visibility -
is it possible to show a field on a specific page id() ?
adrianmak posted a topic in General Support
I know I could create a new template for that. Without create a new template, is it possible to show a field on a specific page edit ? -
PW 3.0.12: Support for extended (UTF8) page names/URLs
adrianmak replied to ryan's topic in News & Announcements
I'm wondering this is not a good implementation How to handle utf-8 url on other php framework or CMSs ? Are they do the same to put thousands of chars on a list ? -
PW 3.0.12: Support for extended (UTF8) page names/URLs
adrianmak replied to ryan's topic in News & Announcements
For chinese chars, in real case the page name should be any of chinese chars. putting used chinese chars on that config parameter is not applicable. -
child pages which are not required a output template
adrianmak replied to adrianmak's topic in General Support
I will try later Edit: Tried as expected. -
There are two templates in Parent and Child relation Child template has no output template, and it is used to hold information. While Parent has output template where all child pages will loaded and output in the parent template When I create a child page under parent, it still required to give a page name (ie url). Is there any alternative method to build child pages and not required a dedicated url/page name
-
Let say there are three db table one table is storing raw data of each channel where channel wth fields id, name, rawdata another table is user table with fields, id, username, password the last table is user perms with fields, id, access, which store a user could access what channel of the channel table sample table of user perms may look like this id,access 1,"1,2,5,8,9,10" 2,"3,4,7,11" 3,"10,12,18,19,21," id is referenced to the id of user table id, and access is referenced to the channel table id which a user could access how do I , from the access field to select those channel ids from channel table ? after extracted the id from access fields on by on, a query may look like where cid=1 or cid=2 or cid=5 or cid=8 or cid=9 or cid=10 It may work but I'm wondering it is not quite efficient
-
How to not allow user to add child from the parent page?
adrianmak posted a topic in General Support
I setup a page template which has a pageTable field. To display the child page (on front-end) of the PageTable field in the parent page, user should edit the parent page and add child page within here. However, I found that many users are likely use the "New" button from the parent's context menu. As a result, users always ask me why their child pages could not show on the front-end. What can I do to avoid user to add child pages from the parent's context menu ? Hide the “New" button ? -
cache is not working properly for multiple templates
adrianmak replied to adrianmak's topic in General Support
My problem has been solved from another post. Anyway, thank you @Can -
I found that there is some minor issue with the code. All admins pages, even the pw's admin backend login page (cached), it is not possible to login to the backend. How could excluded all admin related pages not to cache? Updated: I solved by myself. Simply checking the template whether it is a admin template. If it is a admin template, dont read or write cache
-
I tried to append string <!--cached page--> before cache saved into db I altered the code into if (!$cached) { $cached .= "<!--cached page-->"; $cache->save($cacheName, $event->return); } However, checking with the cache table the string didn't append
-
Dont you think a single db query or a flat file cache, which one is faster?
-
I overlooked the two underscores has such a meaning. Thanks for pointing it out. My problem has been solved.
-
@Can Your code save me a lot. But it is still not quite working on my problem My $cacheName is look like this "$config->prefix__$page->id-$page->template-{$user->language->name}"; When I checked back the cache table, the cache name has no such a prefix . As a result, mobile devices are still received the cache of desktop template. Is the $config variable is not vabailable in ready.php scope ?
-
@Can I copy your ready.php code of second post in my site/ready.php Then I refresh several pages, but i didn't see any files output under site\assets\cache\ folder
-
@Can how's the _out.php look like in order to work with wirecache?
-
cache is not working properly for multiple templates
adrianmak replied to adrianmak's topic in General Support
if i want to mobile template and desktop template are both working with cache, how the wirecache could help me? could u please give me a little bit more details? -
I have a pw site which has two set of templates. One if for desktop another one is for mobile device I used a mobile detection library to load mobile template for mobile devices. Here is the code snippet in config.php require_once("mobile_detect.php"); $detect = new Mobile_Detect; $config->mobile = false; $config->prefix = "desktop"; if($detect->isMobile()) { $config->urls->templates = $config->urls->site . 'templates-mobile/'; $config->paths->templates = $config->paths->site . 'templates-mobile/'; $config->mobile = true; $config->prefix = "mobile"; } It's working fine without template cache enabled. If I enable a template cache, the mobile template is not working anymore. Mobile devices always load the cache of the desktop template.
-
is is possible individual field setting for different template ?
adrianmak replied to adrianmak's topic in General Support
what is the purpose of the second if statement ? -
There is a page will number of child pages. A list of child's title will be listed in the parent page. The list of childs fill be listed in 3 of a row as following html markup. While using foreach loop how to create a new row for each of three child? <div class="row"> <div class="col-xs-4"></div> <div class="col-xs-4"></div> <div class="col-xs-4"></div> </div> <div class="row"> <div class="col-xs-4"></div> <div class="col-xs-4"></div> <div class="col-xs-4"></div> </div> <div class="row"> <div class="col-xs-4"></div> <div class="col-xs-4"></div> <div class="col-xs-4"></div> </div> <div class="row"> <div class="col-xs-4"></div> <div class="col-xs-4"></div> <div class="col-xs-4"></div> </div> My current code is. But it will not create three in a row html markup $out .= "<div class='row'>"; foreach($page->children as $p) { $out .= "<div class='col-xs-4'>"; $out .= "<img src='{$p->images->first->url}' class='img-responsive'>"; $out .= $p->title; $out .= "</div>"; } $out .= "</div>";