-
Posts
1,078 -
Joined
-
Last visited
-
Days Won
17
Everything posted by dotnetic
-
@joer80 @marcura The problem with the missing images can be fixed if you use the path instead of the URL $page->getUnformatted($fieldName)->first()->filename This is also working when you use pageFileSecure setting in config.php for protected files. Sadly when using the path instead of the URL, the image can not be shown in the webbrowser, but is available in the PDF.
-
It seems that you have $config->pagefileSecure = true; $config->pagefileSecurePathPrefix = '-'; in your config, is that correct? I had the same and to fix it you have to use the disk-filepath instead of an URL because the URL is protected via .htaccess. So I used $page->getUnformatted($fieldName)->first()->filename instead. Sorry, I did not read your comment correctly. If you use images in a textarea I think you could replace the relative image url with a textformatter.
-
@adrian Yes, this module works flawless, and I had an error in my own hook, so there IS a way to hide the "page" navigation item already. Don't know, why it worked before, and now it did not. Also I don't know why I did not tried this module, because I was aware of it. However, I still think my pull-request is a valid option, for changing the navigation.
-
@adrian Thank you for the latest additions and your continous great work on this essential module. I can't wait for the API explorer panel. This is great and would save me a lot of time going to ProcessWires API reference page and look for what I am searching. One thing that would be extremely useful would be a find-as-you-type-filter, to find what you are looking for quickly, similar to AdminOnSteroids filter function for AdminDataTables or modules.
-
Please read my comment about a proposal change for what is rendered in the navigation
-
Change Default Admin Page Loaded / Hide Pages Tree
dotnetic replied to geekpete's topic in Getting Started
Please read my comment about a proposal change for what is rendered in the navigation -
It seems all solutions, including my own one from here don't work with AdminThemeUikit. So I proposed a change to the getPrimaryNavArray function which you can read on github and enables us to hide the "pages" menu item from the top navigation. Vote for it, if you like. EDIT: Actually, there is a working module from @netcarver - http://modules.processwire.com/modules/admin-restrict-page-tree/ My own function had an error and now I replaced it with the mentioned module. @bernhard Maybe this interesting for you also?!
-
@ryan It is an idea to implement anonymous installation statistics into the core. A user can choose if he wants them activated or not (think data protection). With this approach there would be an overview of how many sites approx. use ProcessWire. But it's up to Ryan how important this feature would be.
-
@Nvim I never said it is accurate: There is no accurate way to detect how many installations there are. Some people (like myself) are even building applications with ProcessWire which are not publically available.
-
Help needed: Link to or search in multiple fields
dotnetic replied to Hajosch's topic in Getting Started
First of all I want to say that learning PHP is crucial to get going with ProcessWire. You should understand the basic syntax and concepts and how to iterate over items. Please also read http://processwire.com/docs/tutorials/but-what-if-i-dont-know-how-to-code/ However, you should create a template file "authordetails.php" in site/templates/ directory, then in ProcessWire admin also create a template with the same name (but without the .php suffix). Then assign this template to each author and editor. In the authordetails.php file enter the following code to get all publications for this author/editor: $publications = $pages->find("template=publication, authors|editors={$page->id}"); Please note the double-quotes, that are required for {$page->id} to work!!! If you are using a more recent version (3.0.107) of ProcessWire you could instead use $publications = $page->references(); please read http://processwire.com/blog/posts/processwire-3.0.107-core-updates/#page-gt-references about this. Then iterate over the publications foreach ($publications as $publication){ echo $publication->title; } All this is completely untested and comes directly from my brain, so I hope everything works. -
Help needed: Link to or search in multiple fields
dotnetic replied to Hajosch's topic in Getting Started
If I understand you correctly you want to display a list of all publications, where the author OR the editor is = the name that you clicked? For this you would need a selector like $publications = $pages->find('template=publication, authors|editors%=name_of_the_author'); Please take a look at https://processwire.com/api/selectors/#or-selectors1 how to use OR selectors. Please also note, that you have to use $pages, instead of $page and "find" instead of "get" to find the correct pages. $page is the actual page you are on, and queries the fields you mentioned on the actual page. $pages->find performs a search on all pages that match your selector and returns the result. You then have to iterate through the result, to display all books/publications of that author/editor. -
Please take a look at the thread and also https://publicwww.com/websites/"X-Powered-By%3A+ProcessWire"/ but it tells only a part of the story, as it can not list all sites, because some sites turn off the x-powered-by header.
-
[SOLVED] Add class to FieldtypeTable before outputting it
dotnetic replied to dotnetic's topic in API & Templates
Thanks @Soma, this works fine. Maybe it is a solution for other fieldtypes I have too. -
[SOLVED] Add class to FieldtypeTable before outputting it
dotnetic replied to dotnetic's topic in API & Templates
@kongondo This also doesn't work. @OLSA This won't work because it is a FieldtypeTable and not a FieldtypePageTable, as you can see in the screenshot: -
[SOLVED] Add class to FieldtypeTable before outputting it
dotnetic replied to dotnetic's topic in API & Templates
Sadly $inputfield->addClass() does not work. -
[SOLVED] Add class to FieldtypeTable before outputting it
dotnetic replied to dotnetic's topic in API & Templates
I found a way with str_replace, but I think this is not the best way. Here is what I added to my getFieldValue function: if ($fieldType == 'FieldtypeTable') { $value = str_replace('ft-table', 'uk-table', $value); return $value; } Suggestions, how I can do it better? -
[SOLVED] Add class to FieldtypeTable before outputting it
dotnetic posted a topic in API & Templates
How do I add a class "uk-table" on the frontend to a FieldTypeTable? I am iterating through all elements from an admin template and eventually modify the values (for example concatenate the values of a Page field with a comma), but I don't know how to add the class to the table. The code that I am using right now is in a gist at https://gist.github.com/jmartsch/768d9dc19293528fe9ae82b7a8ee1c42#file-home-php In line 15 https://gist.github.com/jmartsch/768d9dc19293528fe9ae82b7a8ee1c42#file-home-php-L15 I tried to hook into the rendering, but as it is no Inputfield anymore, the hook does not work. Can someone help me please? -
It would be nice, if this theme would be selectable as an option on the user profile page instead of replacing the standard Uikit theme. An option to use the normal unmodified AdminThemeUikit would also be good in my opinion.
-
Or even easier with $session->redirect("/user-profile/$user->name");
-
Hey @tpr there are settings in AoS for PageListTweaks: Always show pagelist actions and Always show extra actions. Could you make them work also in a ListerPro? I can confirm this bug.
-
How to render admin page into a variable to create a PDF?
dotnetic replied to dotnetic's topic in General Support
Thank you all for your insights and information. Most people think, that it would not be a smart thing to render the default admin markup. However I am still evaluating options and trying out different things. Thanks @Robin S for his code. At a later time I would like to get an export of many PDFs (100 or 1000, I don't know yet, how many my customer would handle). I tried to find the perfect tool for generating the PDF. I tried WeasyPrint (written in Python) which has very good rendering capabilities. The problem is, that I have to call it from PHP via exec(), and it gives no feedback or errors. Additionally WeasyPrint requires an URL or a file to render to PDF, but does not know anything about my login status in ProcessWire. As my PDFs and pages are protected and should only be visible to logged in users, this is not a real solution ? Another problem is performance. The generation of 100 PDFs from pages would take a long time. First the page with over 150 fields has to be rendered and then the PDF has to be created. Multiply the time with 100 and you are waiting a looooong time. So right now, I think I use the Pages2PDF module which generates a PDF for a page on save and saves it to disk. As a template for the PDF I will try Robin's code to iterate through the Inputfields and get a clean output. When a user then wants to get an export of all PDFs, I just have to gather the files and zip them or combine them into one PDF. This would be really fast. What do you guys think about this approach? -
How to render admin page into a variable to create a PDF?
dotnetic replied to dotnetic's topic in General Support
They are regular admin pages. Then in a module I would like to add a button that gathers the HTML of the admin pages and generates one or multiple PDFs out of it. -
How to render admin page into a variable to create a PDF?
dotnetic replied to dotnetic's topic in General Support
I have seen Adrian's answer but to hook into the rendering, I need to render the page, as you did in your example. The problem with your example is, that it does not get the HTML of the admin page, but instead of a template file that resides in site/templates. But I need the HTML from the admin page. -
How to render admin page into a variable to create a PDF?
dotnetic replied to dotnetic's topic in General Support
But my main question remains: How do I get the HTML of the admin page? Most important is, how do I get it when I am not actually on the page. Because I want to get the HTML of multiple admin pages.