-
Posts
1,306 -
Joined
-
Last visited
-
Days Won
13
Everything posted by Juergen
-
Hello Renobird, you are right - it depends on the browser. I use the Firefox 39. If I use the latest IE the description is above as LostKobrakai said. It seems that Firefox has more problems at the moment. I have also a problem with browser resize and responsive images. This is also a well known bug in the latest version.
-
Here it is what the grid looks like in my backend. There is CSS problem at the description of the image field in the grid system. The description floats next to the images so a description clearing maybe would solve the problem. Best regards
-
Yes I can verify that: Here are some screenshots: 1) image field selected in the template setting section 2) image in the user profile template 3) image settings in image field detail tab 4) Here it is what it looks like in the template nav Best regards Juergen
-
Thanks for the awesome template, but in my case the user image will not be displayed at all. I have selected the image field in the settings.
-
API how to delete files with hook "after page save"?
Juergen replied to Juergen's topic in API & Templates
If the image or file upload field is not in an repeater, you can delete it with this line of code: $page->nameofyourfield->deleteAll(); -
API how to delete files with hook "after page save"?
Juergen replied to Juergen's topic in API & Templates
I have used $p->delete($p->filename) and it works!! Thanks -
Hello @ all, I am using a hook method to empty some database tables after the save action under certain conditions. It works just fine for "standard fields" with text, but i run into problems by deleting files (images or other files such as pdf). Here is the code that I use: //clean all up if event is cancelled if(($page->template == "events") AND ($page->cancelled == "1")){ $this->message("Folgende Felder wurden geleert: Einleitungssatz, Hauptteil,...); $page->body = ""; $page->introtext = ""; foreach($page->downloadrepeater as $p){ $p->downloadfield = ""; $p->downloadfieldtitle = ""; $p->downloadfiledesc = ""; } } The fields body and introtext will be deleted as expected. The file fields are in a repeater field (downloadrepeater). Therefore I use the foreach loop. The repeaterfield consists of 3 fields: - the file upload field (=downloadfield) - the title field for the file (=downloadfieldtitle) and - the description field (=downloadfiledesc) The values of the title and the description field will be deleted too - so this works. The problem is to delete the file of the file upload field. I know that $p->downloadfield = "" is not the right approach but I have tried it also with delete(). Unfortunately I was not able to figure out the right syntax to delete the file too. Can someone help to get the right api call? Best regards
-
Maybe this could be an approach to generate a sitemap for a multilingual site. https://processwire-recipes.com/recipes/create-xml-sitemap-for-every-language/
-
if(($page->template == 'pricelist') OR (($page->template == 'admin'))) { The addition "$page->template == 'admin'" fetches the admin template in backend too, but in this case the hook is added to every template in the admin. I have tried to add the page id of the pricelist template in the admin section too but this doesnt work. if(($page->template == 'pricelist') OR (($page->template == 'admin') AND ($page->id == '1409'))) { Is there a way to fetch only a specific admin template?
-
Hello @ all, I have tried the new hook files (init.php, ready.php and finished.php) from the latest update (2.6.7) on the dev version and they work well on frontend. But I havent got it to work in backend. Here is a test example that runs on frontend as expected: $page->addHookAfter('render', function($event) { $page = $event->object; //test if($page->template == 'pricelist') { // $value contains the full rendered markup of a $page $value = $event->return; $value = str_replace("</body>", "<p>Hello World!</p></body>", $value); // set the modified value back to the return value $this->message("Hello world added"); $event->return = $value; } //test end }); It is only a test that adds "Hello world" on pages with the template "pricelist" on the frontend. But it doesn add anything in the backend on the pricelist template. Is it possible to use this new files to add hooks in the backend too and if possible how? At the moment I use a module from Soma to add hooks in the backend (HookAfterPageSave-Module). Thank you for your answeres
-
This was the problem. I have forgotten to include the child pages template. Thanks Wanze
-
Thanks LostKobrakai. Thats a quite good idea to try it out.
-
Is it possible to include child pages in the PDF?? I have created a pricelist and each item of the pricelist is a single page. On the pricelist template I output all child pages with a foreach loop. The result is my pricing table. Unfortunately on the PDF the content of the child pages is not visible, so I have an empty page.
-
Thank you Nicolas and Macrura for your suggestions!!! Unfortunately I have forgotten to mention that the child pages are part of a Page table field on the parent page. So here is my solution to search the Page table field with its "sub fields" from the child pages and output only the parent page in the search results if a search term was found in one (or more) child page(s). This are the fields of the Page table field to search: $pricelistfields = "servicepricelist.title|servicepricelist.description"; The Page table field name in my case is "servicepricelist" and I search in the "title" and the "description" field which are part of the child pages. The next step is to exclude all the childpages in the search to prevent duplicate content. $selector = "$searchfields~=$q, template!='pricelistitem', limit=50"; $matches = $pages->find($selector); I add "template!='pricelistitem'" to the search selector, because the template name of the child pages is "pricelistitem". So I get rid of all matches in the child pages directly. It only shows matches in the parent page. Thats all!
-
Hello @ all, I have a parent page (pricelist) with a lot of child pages (pricelistitems). I use the standard search code from this forum for my search result page and it works quite well. The structure of the pricelist: -pricelist (parent page) -priclistitem1 (child page) -priclistitem1 (child page) -priclistitem1 (child page) -priclistitem1 (child page) ........ The parent page is the main page and each pricelist item is a child page. They all are real pages with their own url. Problem: If I search for a specific term and this term could be found in a child page, then I got the URL to the child page in the search result. This is what I do not want. I want to get only the url to the parent page in this case, because this is the page visible to the visitor. The child pages are only parts of my pricelist. I have searched the forum and found some similar entries but not exactly what I am looking for. Can anyone point me into the right direction?
-
It would be great if the pages inside a Page table field would be sortable (each column) and searchable. If you have a lot of pages (fe. 50 pages) inside a Page table and you want to edit a specific page you have to look for it manually. So it would be great to add a searchfield or maybe even a filter to search for a specific page inside the Page table. I would make working with Page table much more comfortable.
-
It would be great to add limitiations (f.e. output 7 repeats without the possibility to add or to remove a repeat) to the repeater fields (like permanent repeats) This can be used for example for opening hours (output 7 repeats each for one day). The customer has no possibility to delete or add another repeat. The limitations should be placed under the details tab.
-
- repeater
- repeater field
-
(and 2 more)
Tagged with:
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
Juergen replied to Nico Knoll's topic in Modules/Plugins
Thanks for your answere Nico!! I will try it out. -
@iNoize As fas as I know it is not possible. I have worked in the past with api forms and gave it up. I also needed a special markup (in my case Bootstrap). It was not possible to get the exact output as I wanted. Therefore I write forms manually. It is the best way to get full control over the output.
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
Juergen replied to Nico Knoll's topic in Modules/Plugins
Havent installed it yet, but is this module ready for multilingual sites? Best regards -
Language Translation: don't remove double content
Juergen replied to Nico Knoll's topic in Wishlist & Roadmap
Yes this would be a nice feature. It is always frustrating if you are checking your language files for untranslated strings and then you find out it is only the same as the original string and no missing translation. -
So, now it works as expected with this piece of code, but I cannot find a explanation how to delete the value of the specific field: if(($page->template == "pricelistitem") AND ($page->pricetype == "1")){ $this->message("Angebotspreis wurde entfernt"); CODE TO REMOVE THE VALUE OF THE FIELD "OFFERPRICE"??? } The message will be shown if the pricetype field is 1 (= standard price). How can I delete the value of the field "offerprice" so the field will be blank??