-
Posts
7,479 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
Switch Statement to control included files
kongondo replied to louisstephens's topic in API & Templates
$config->httpHost; This does not return a URL. It returns the Current HTTP host name. E.g. processwire.com, hence doesn't match your cases. Edit: In addition, since you are in a function, your headerSwap() function does not know what $config is. You will need wire('config'). -
Or...if those items within each list are some child pages or some items in page fields (those are the usual approaches), all you need to do is to generate them in your template file. For instance, if you had the following site structure: Home Categories Tanks and Spaghettis T-Shirts and Polo T-Shirts Brands Apple ASUS Mobile Phones Mobile Phones Android Phones Foot wears Sports Shoes Casual Shoes Books Literature and Fiction Competitive Exams In template, you would do something like this. $items = $pages->find('some-parent-template');// this is the template for Categories, Brands, etc... foreach($items as $item) { // some code here...to build Column Headers foreach($item->children as $child) { // code here to build list } }
-
Maybe if you explained exactly what you would like to achieve? Creating fields only to store unordered lists might be an overkill. Welcome to the forums btw..
-
I think you got the wrong forum @alinamikecake. This is the ProcessWire forum. I see nothing regarding ProcessWire in your post, unless I am mistaken.
-
You could truncate the tables using phpMyAdmin or similar. See this, for instance:
-
I can only guess what's going on at this point. I suspect the upgrade didn't go smoothly. Are you able to downgrade and try again? Also, anything relevant in this thread?
-
Strange. You say you copied the complete page to your local computer....etc. If you could also clarify: AMP versions: PHP, etc... Is this happening on all pages regardless of the templates they use? What about editing existing pages; are their values saved OK? Did you have Tracy Debugger installed? If not, could you install it and see if it catches any errors? Is there some Hook(s) running on page save?
-
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
Excellent! Glad you got it working. Edit: If you can mark this as solved then, by editing the title of this thread to [Solved]....rest of title... -
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
Is this it? http://stackoverflow.com/questions/19073270/stop-caching-for-php-5-5-3-in-mamp OPcache is enabled by default is some version of MAMP. -
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
Everything works as expected here. Changes made in the template file are reflected immediately when I reload the browser, whether I am logged in or not. I have tested in PW 3.0.42. Maybe some MAMP thing? -
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
I get you now. You are making changes in the template file and those are not being reflected in the frontend unless the cache is cleared, right? Let me test that. -
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
I am a bit confused. Isn't that the expected behaviour? You change a value, you save, then you see the new value? Please also see my edit in the post above yours. -
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
Is this happening for all pages (i.e. for different templates) and all fields (i.e. title versus body fields, etc)? Edit: Just notice you said you are using $p->render()? Can you show us some code? -
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
I see. I am not seeing that at all in my tests. Looks like a Markup or Field or most likely Template cache. Are you sure you did not accidentally enable cache for the template that page uses? See Cache Tab when editing the said template. -
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
When it comes to styles, my bet's on browser cache. If you want Chrome to fetch assets from the server, leave the dev console open as you develop, or develop in an incognito tab. From what I know, ProcessWire does not cache anything in the frontend unless you implemented that yourself, e.g. MarkupCache, etc. -
solved is page render cache always enabled?
kongondo replied to sakkoulas's topic in General Support
You are sure that's not your browser cache? -
That's strange. Maybe let's start by refreshing the cache several times...sometimes doing it once doesn't cut it. This includes refreshing/deleting the ProcessWire 3.x compiled files; it will rebuild them if you delete them. What modules do you have installed? You also need to re-enable JS. That's required in the admin. No console errors you said?
-
Haven't read or understood your whole post but if $input->whitelist->st is an array, and $st->name I guess is a string, in PHP, you cannot compare an array to a string like that.
- 21 replies
-
Welcome to the forums @timop_mug. A couple of questions: What version of 2.x exactly was that? Older than 2.4 for instance? Do you have $config->debug set to true? Any errors? Errors in the logs?
-
Just cross-referencing an almost identical question asked an hour or so after yours:
- 1 reply
-
- 1
-
Not an answer to your question. Just pointing out a coincidence that an almost identical question was asked within the hour. Anyway, I am cross-referencing the two threads:
- 20 replies
-
If you went with RuntimeMarkup, you could ask @Macrura how he did it as per this example:
-
Have you tried something like this? $out = ''; foreach($page->page_table_field as $p) { $out .= $p->render(); } echo $out; Of course, change $page as needed
-
@Zeka, No is the answer This will first return the PageArray (i.e. load pages) and then do an in-memory count. More like counting items in an array. This will do the counting at the db-level, hence faster and more efficient if all you want to do is count.
-
Just a bit of an explanation for the next guy....: This will retrieve the pages, return a PageArray (PHP Object), which might end up using a lot of memory. Instead what you want is just the count of pages... Which brings us to this. This is very efficient. It will only count these pages and return an integer, not only doing its job very quickly but using next-to-nothing memory.