Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/07/2017 in all areas

  1. I was a little hesitant to reply at first because I am a newbie to Processwire, also coming from a Wordpress background. However, I thought on the other hand, perhaps my point of view (similar to your background @svsmailus) is exactly one of the points of view you might want to hear from, in addition to those from experienced users. I would classify myself as mostly a non-coder, however from customizing minor stuff on WordPress over the years, I've managed just fine starting out in Processwire, so if that's you then you would be fine too. Learning-wise, I picked up what I needed to know as I went. I am still learning as I go. It all comes down to what you want to do with your site. I don't have the know-how to create a fancy site with lots of user input or advanced features like that, but on the other hand I needed something beyond a standard blog, with a totally custom layout and customized data fields; all of which I couldn't achieve on my own in WordPress. People have been helpful on the ProcessWire forum and usually I can find what I need by searching, and upon asking a question I got some really great answers, one of them with code shown that I could (and did) use and which proved super-helpful for my custom needs. All that being said, it is a bit more of a learning curve in Processwire and yes you do need some basic PHP (although so far I haven't used much more than echo statements and if...then statements), and a few chunks of HTML and CSS. I've never used the blog module for PW so I can't comment about that. Instead I created my own theme files (I actually based them off the free responsive W3 CSS templates) and made a page template of basic-post which consists of a navbar, a header, the page content, and footer, so it's pretty simple. That could be a great place to start. To begin with I added in some custom fields like featured image, and a check box for if I wanted to display the image on the basic-post template (this allows me to toggle on/off the display of featured image at the top of the article, for example I like to toggle that off if the body of my article is already image-rich). I was able to add to my layout as needed and put my extra customizations and extra display fields in. Overall, from the beginner's point of view, as a beginner myself to ProcessWire, I wholeheartedly agree with what @Peter Knight said. The way he suggested is how I happened to do it myself and I can already see how powerful and un-bloated ProcessWire is (compared to Wordpress). It's also actually fun! I also agreed with what @louisstephens and what @adrian said (and many others too; those two just stood out) in that as a beginner you don't actually NEED a whole lot of PHP at all besides echo, if-then, and foreach.
    10 points
  2. First, I really like this admin theme! So what follows isn't meant to be a full picture of my reaction to it because overall I love it - just a few things that could use tweaking IMHO. Fonts Currently users will see completely different fonts depending on what OS they are using. The font-family rule is: font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif It's become popular lately to use system fonts like this (was it GitHub that started it?) but the problem is that the fonts in this stack are not very similar. It's one thing to fall back to Arial if Helvetica isn't available because they are so similar that the average audience won't be able to tell the difference. But San Francisco, Segoe UI, Roboto and Helvetica Neue are completely different typeface designs. So for instance there will be no consistency with x-height or position of type within the line-height box across platforms, so what looks pixel-perfect on MacOS might look sloppy on Windows or some other OS. If the desire is to move away from the bog-standard Helvetica/Arial then wouldn't it be better to bundle an open-source webfont kit with PW so there is reasonable consistency across platforms? From the blog post screenshot: From the demo site, Windows 8.1: Search box Like the current default admin theme search box styling, I think this is way too subtle: I have 20/20 vision and I can only barely make out the bounds of the search box - imagine what it's like for users with less-than-perfect vision. The search feature is hugely useful for quickly finding a page to edit in a deeply nested tree structure, so we want users to know that it exists. With the current admin default theme, most of my clients had never noticed the search box (until I boosted the contrast in some custom admin CSS). Tab metaphor For a tab metaphor to make sense there has to be some visual connection between the active tab and the content within that tab. Otherwise it isn't clear what content on the screen is controlled by the tab. On this screen... ...not knowing better, I would expect the tabs to control only the Title, Date and Headline fields. Body looks like it is outside of the tabbed content and so the expectation is that it remains on screen when switching to a different tab. Of course you learn how it works once you use it, but every time a thing works differently to how a user expects it to work there is a little bit of mental friction - a bit more effort required to understand it and a bit less satisfaction. I understand that there is a setting for controlling the border style of different fields (although it is disabled in the demo so I couldn't easily try it) - that's great. But I think the default style should be one that lends itself to the tabbed interfaces that are used throughout the PW admin (i.e. a visible border that connects to adjacent fields that are within the same tab). Breadcrumb separator Getting a little nit-picky here, but I think a guillemet › is a better breadcrumb separator than a slash /. The breadcrumb is supposed to indicate a hierarchy of pages. With the slash there is less sense that Posts is within Blog. It looks like a group of items that are all on the same level. Container width My preference is for some max-width to be set for pw-container (1600px maybe?). On my 2560px-wide monitor the interface becomes too wide for comfortable use. But that's an easy override for me to apply if there's no agreement on that.
    9 points
  3. If anyone's interested, I've forked Ryan's ProcessWireUpgrade module and added the ability for it to detect if github has a tagged release for the latest version of each listed module (except for the PW core repos which will require special handling). If a tagged release entry is found, it then adds an extra link to the table. This is strictly an alpha "proof-of-concept" experiment, but if you are interested my fork of the repo is here - just replace the current version of the module code with my fork and you should be OK. Providing module authors start tagging their releases on github, it will allow you to navigate to the release notes for review before you hit the upgrade link. As you can see, Mike Rockett has already started tagging his releases - and hence his module gets the extra "Release Notes" link. Worthwhile idea?
    4 points
  4. I'm using a highly modded version of ProcessGeneralSettings; got it working with most fieldtypes, so i can setup settings dashboard now and have fields for most things i need on the frontend, social media urls, metas, company info as well as visual settings; it all stores as module config, so i can have a lot of fields (50-60) without having to add those fields to PW...
    4 points
  5. i haven't looked at the functional fields yet... Here is my version of PGS: https://github.com/outflux3/ProcessGeneralSettings
    3 points
  6. Hey everyone. I am at a stage of code cleaning for my first PW profile where I decided to implement some sidebar widget logic that would allow me to remove code repetition. I read about a few widget logic approaches that were working fine but that seemed too complicated for my needs so decided to implement something really simple that would do just that - widget logic that can be changed through the admin but not through code editing. So before I share my idea, I would give you some info of the structures I have: -- Recipes ---- Child 1 ---- Child 2 -- Ingredients ---- Child 1 ---- Child 2 So in my project needs, I wanted to have a solution that would allow me to set through the profile admin one or group of widgets per template (it would allow unlimited widgets as far as I have the code for it). So to achieve this functionality, I took the following steps: 1. Create a template, called widget_logic and set the allowed template for children to be itself (widget_logic) 2. Create a page Site Widgets and assign to it the widget_logic template. 3. Create a field called listing_widgets and set its type to Page Reference. 4. In Details tab select Multiple Page Array to allow multiple widgets to be selected. 5. In the input tab chose Page Auto Complete as input field type. 6. In Selectable pages point the parent to your widgets page name (Site Widgets in this example) and set the widgets_logic as the template. 7. Repeat the steps 3-6 creating another field: inner_widgets (this would allow you to have different widgets per listing template and inner page ) 7. Add manually the child pages with the widgets names in Site Widgets page you just created. 8. Assign the fields to the parent templates that you want the widgets to be pulled from (in this case: Recipes, Blog etc.) 9. In the template code, pull the page parent through API using the loop you use to list the results in the page. For this tutorial I will set the widgets to Recipes template that shows a listing of all the recipes matching my criterias: //Build a selector and limit page results to 5 $result = $page->children("limit=5, sort=-published"); //Pull the parent of the first child-page to be used for widget logic $parent = $result->first()->parent(); 10. Once we know the parent and we know the field names assigned to it containing the widgets, we use a simple loop in each template to get the selected widgets name and include them where needed. Note, for the widgets naming I used: widget-XXX-YYY.php (eg. widget-recipe-top.php). If you prefer other naming, make sure you change the include line to match the new names. //Loop through all the widgets setup in the parent template foreach ($parent->listing_widgets as $w) { //Including all the widgets by file name and order set in the parent widgets field include ('./includes/widget-' . $w->title . '.php'); 11. In the Recipe-inner template I would do the same: $parent = $page->parent(); //Loop through all the widgets setup in the parent template foreach ($parent->inner_widgets as $w) { //Including all the widgets by file name and order set in the parent widgets field include ('./includes/widget-' . $w->title . '.php'); } NOTE: in the inner page template I changed the field name to inner_widgets to pull the widgets for the inner page. 12. Now all that is left is to assign the two fields to every parent and/or inner page template that you would like to use the simple widget logic and select the widgets for each one. It might not be the best approach, however it is super simple to setup and allows me to have different widgets on any template now. The variety of widgets could be extended at any time by just adding the new widget, create the page with the name for it and assign it to the chosen template. Having the Page Auto Select field would allow you to drag and drop the widgets to reorder them so it suited my needs perfectly. Hope it would for you as well. Any code improvements are more than welcome (as usual P.S. On the image of widgets view, I set the size of both fields to be 50% so that they show up on the same line and save the space and scrolling.
    2 points
  7. Take a look at: http://modules.processwire.com/modules/lazy-cron/ You can set that up to check at whatever time interval to make an API call to remove unverified accounts.
    2 points
  8. I think the new admin theme is a big step ahead! I really like it. I'm now starting to play with it and found a small inconsistency in regard to translations: In the upper nav bar, "Seiten" (does mean "Pages" in English) is translated by german language pack. "Pages" below this, however, is the page title of the "Pages" page (Page ID 3) inside of "Admin" (Page ID 2). I figured out that "Pages" can be translated as well by editing the "Pages" title, but this page has to be unlocked first in order to edit the title. I'm not sure if everyone who uses this theme knows how to follow these steps to get a fully translated theme. I think this should be handled somewhat more consistent - either the Page title or the translation file should be used in both cases. To be honest, I wonder if it has any unforeseen side impacts if the titles of "Pages", "Setup", "Modules" and "Access" pages inside of "Admin" are changed? ...and, for my personal taste, the upper (darker) bar (masthead?) has a little bit of too much height
    2 points
  9. GitHub issue opened here: https://github.com/processwire/processwire-issues/issues/399
    2 points
  10. @svsmailus you don't particularly need deep working knowledge of PHP. The API is really simple to use. I came into this with almost zero knowledge of PHP (but a basic knowledge of general programming principles), a year later and I'm doing some really cool things. Not as cool as some of the guys here but this isn't a competition, they are very generous here with sharing the knowledge. In my opinion, if you want to progress in any CMS, this forum is the place to be. Processwire has allowed me to do things in the one year that took me much longer to achieve with the convoluted and plugin dependant ways of other CMS systems, including Drupal 7 & Wordpress. My templates output exactly the HTML I want and no more and querying the database is so simple. This in turn has saved me a bunch of time with the CSS as I don't have to style out classes chosen by the plugin developers thus being able to reuse code a lot easier across multiple sites. In regards to hosting, after changing a few times over the years, I use 'Kualo' now. They have been absolutely outstanding for support and the live chat is great. If you're anything like me, that is, very curious, like to ask a lot of questions and are keen to learn, then there's nothing stopping you! I am also working on a blog with a bunch of basic tutorials for people right at the beginning like yourself, hoping to go live within a couple of weeks (once I have some more content). Good luck ==EDIT== p.s. welcome to the forum!
    2 points
  11. NOTE: This thread originally started in the Pub section of the forum. Since we moved it into the Plugin/Modules section I edited this post to meet the guidelines but also left the original content so that the replies can make sense. ProcessGraphQL ProcessGraphQL seamlessly integrates to your ProcessWire web app and allows you to serve the GraphQL api of your existing content. You don't need to apply changes to your content or it's structure. Just choose what you want to serve via GraphQL and your API is ready. Warning: The module supports PHP version >= 5.5 and ProcessWire version >= 3. Links: Zip Download Github Repo ScreenCast PW modules Page Please refer to the Readme to learn more about how to use the module. Original post starts here... Hi Everyone! I became very interested in this GraphQL thing lately and decided to learn a bit about it. And what is the better way of learning a new thing than making a ProcessWire module out of it! For those who are wondering what GraphQL is, in short, it is an alternative to REST. I couldn't find the thread but I remember that Ryan was not very happy with the REST and did not see much value in it. He offered his own AJAX API instead, but it doesn't seem to be supported much by him, and was never published to official modules directory. While ProcessWire's API is already amazing and allows you to quickly serve your content in any format with less than ten lines of code, I think it might be convenient to install a module and have JSON access to all of your content instantly. Especially this could be useful for developers that use ProcessWire as a framework instead of CMS. GraphQL is much more flexible than REST. In fact you can build queries in GraphQL with the same patterns you do with ProcessWire API. Ok, Ok. Enough talk. Here is what the module does after just installing it into skyscrapers profile. It supports filtering via ProcessWire selectors and complex fields like FieldtypeImage or FieldtypePage. See more demo here The module is ready to be used, but there are lots of things could be added to it. Like supporting any type of fields via third party modules, authentication, permissions on field level, optimization and so on. I would love to continue to develop it further if I would only know that there is an interest in it. It would be great to hear some feedback from you. I did not open a thread in modules section of the forum because I wanted to be sure there is interest in it first. You can install and learn about it more from it's repository. It should work with PHP >=5.5 and ProcessWire 3.x.x. The support for 2.x.x version is not planned yet. Please open an issue if you find bugs or you want some features added in issue tracker. Or you can share your experience with the module here in this thread.
    1 point
  12. TextformatterTypographer A ProcessWire wrapper for the awesome PHP Typography class, originally authored by KINGdesk LLC and enhanced by Peter Putzer in wp-Typography. Like Smartypants, it supercharges text fields with enhanced typography and typesetting, such as smart quotations, hyphenation in 59 languages, ellipses, copyright-, trade-, and service-marks, math symbols, and more. It's based on the PHP-Typography library found over at wp-Typography, which is more frequently updated and feature rich that its original by KINGdesk LLC. The module itself is fully configurable. I haven't done extensive testing, but there is nothing complex about this, and so I only envisage a typographical bug here and there, if any.
    1 point
  13. Ok, let's make it really simple for people using chrome to do this If you are using chrome do this to have PW search with google on the omnibox by simply typing "pw [spacebar]" 1. right click on the omnibox and chose "Edit Search Engines" 2. scroll down until you find these input fields 3. Fill them as in the image: third field should be https://www.google.com/search?q=site:processwire.com%2Ftalk++-site:processwire.com%2Ftalk%2Fmembers%2F+-site:processwire.com%2Ftalk%2Fuser%2F+%s This is the equivalent to this search in Google: "site:processwire.com/talk -site:processwire.com/talk/members/ -site:processwire.com/talk/user/ %s" where %s is the query 4. type "pw [spacebar] Edit Search Engines" and see if this thread appears in first PS: I'm sure there is an equivalent way to do this in other browsers, but I'm not going to look for that now. Edit: simplified the url
    1 point
  14. Page Path History Central Manager Manage all page paths history redirects in a single locations. This module is user interface for the processwrie PagePathHistory module, that creates redirects automatically every time a page is moved/renamed. These redirects do not contain regex's and they will not redirect a user away from a published page making them safe for not technical editors to create. Features Include: Ability to create new redirects Ability to remove old redirects View all the automatically created page path history redirects in your system, and delete any ones that no are no longer needed. Git repo: https://github.com/hagcin/ProcessPathHistoryCentralManager Viewing all existing redirects: Adding New Redirect: Tested on: Processwire 2.6, 3.0 Install Install the module PagePathHistory from within the Processwire admin. PagePathHistory is included in core but not installed by default. Install the module ProcessPathHistoryCentralManager by cloning this repo into site/modules/ in your processwire install. Install the module in the admin interface. You can now manage redirects under setup > page path history central manager Similar to and is compatible with PagePathHistoryManager which lets you manage page path history redirects on a specific page on the settings tab.
    1 point
  15. I like to use the vertical list for images at full size on the slider. I forget to fill in a description if I can't see that field and not found a way to make just this part required so at least I'd get a reminder. Anyway, I like the image nice and big: ...but every time I save the page, it reverts to a smaller image: Can anyone reproduce this? It happens to me with Reno theme and the default classic theme.
    1 point
  16. I just made a textformatter module that allows you to insert dummy content (lorem ipsum style) in text fields via shortcodes. Usage is simple - just type for example [dc3] into a textarea with this textformatter applied (plain textarea or CKEditor) and it will be replaced at runtime by 3 paragraphs of dummy content. It can also be used to populate text fields (for headings etc) using e.g. [dc4w]. This will produce 4 words (rather than paragraphs) at runtime. The actual content comes from an included 'dummytext.txt' file containing 50 paragraphs of 'Lorem ipsum' from lipsum.com. The 50 paragraphs is arbitrary - it could be 10 or 100 or anything in between, and the contents of that file can be changed for your own filler text if you wish. The slightly clever bit is that for any given page, the same content will be returned for the same tag, but the more paragraphs available in 'dummytext.txt', the less likely it is that two pages will get the same content (very roughly speaking - it's actually based on the page ID) so content selection is determinate rather than random, even though only the tags are saved to the db. Update Tags now work like this - [dc3] - Show 3 paragraphs ([dc:3], [dc3p] & [dc:3p] all do the same). [dc3-6] - Show 3 to 6 paragraphs randomly per page load ([dc:3-6], [dc3-6p] & [dc:3-6p] all do the same). [dc3w] - Show 3 words ([dc:3w] does the same). [dc3-6w] - Show 3 to 6 words randomly per page load ([dc:3-6w] does the same). <End update on tags.> If you think it might be useful, you can download it from GitHub and give it a try.
    1 point
  17. I messed around with the Modules Manager recently and found that this module does not fetch a complete module list from http://modules.processwire.com/export-json/, only the first 400 entries are retrieved but there are +- 497 modules in the database. The script you are using is currently set to get maximal 100 modules. You can safely increase the limit value from 100 to 400. Any value set greater then 400 will default back to 10. In this case it is less likely a problem because someone has to have more then 100 modules installed, but you never know. $url = $this->config->moduleServiceURL . "?apikey=" . $this->config->moduleServiceKey . "&limit=100" . "&field=module_version,version,requires_versions,project_url" . "&class_name="; Documentation: http://modules.processwire.com/export-json/ (limit = 1 - 400) Hope this helps, I reported the problem to Ryan. [edit] After going over it again I found out that my previous conclusions are wrong, lol... you can actually read the complete module list in steps using pagination, something that is actually mentioned in the instructions but I didn't see (need more sleep/coffee). 2nd page: http://modules.processwire.com/export-json/page2/?apikey=<key>&limit=250&debug=1 This however is not done by this script or by Modules Manager and should be fixed to make them more reliable. I edited the top part of this post to reflect my new findings and to prevent confusion.
    1 point
  18. Hi @adrian, To date I haven't used the Console panel much, because I prefer to write API snippets in my IDE (API code completion, version control, and having the code saved to disk just feels safer than trusting storage to a module). But I like the way the Console panel shows a handy list of snippets that can be executed by authorised users only (normally just superuser). I see that the Console snippets are stored in the database as part of the module config data. What do you think about using a file for the saved snippets instead, with some scheme for labelling and delimiting the snippets within the file? Some benefits could be: Use an IDE / code editor to write snippets. Version control and file backups become possible. Easily share snippets between projects by copying the file or portions of it. No problems with exceeding the length limit of the config TEXT field in the database. Edit: might be easiest to use one file per snippet, if there's no great performance penalty to that.
    1 point
  19. For one reason or another, output formatting must be off when the PTE inputfield is rendered. To work around this, try... // media_pagereference.php <?php namespace ProcessWire; $refPage = $page->getFormatted('pageReference'); // value will vary depending on "Page field value type" setting if ($refPage->id) { $img = $refPage->image; echo $img->url; } ...or more reliably (since it will work regardless of the "Page field value type" setting)... // media_pagereference.php <?php namespace ProcessWire; $refPage = $page->getUnformatted('pageReference'); // always a PageArray if ($refPage->count) { $img = $refPage->first->image; echo $img->url; }
    1 point
  20. @Missariella I needed to do this the other day: Instead of: $session->redirect($pages->get($contactPageID)->url); I used: // above form <div id="form-top"></div> // redirect to anchor tag after submit $session->redirect($pages->get($contactPageID)->url . "#form-top"); Works great, and no need for iframe
    1 point
  21. You can also store it as a snippet in Tracy's Console panel - note the snippet name in the right sidebar. That way it will always be available and you won't have to remember it.
    1 point
  22. You can put it wherever you want. Depends on how you want to use it. You can put in a template file and it will run when a page using that template is accessed, you can wrap it in a get variable and it will run only when that variable is set. You can make a module and add a page in the admin and add a button that deletes the users. This are just basic examples you can do a lot more than this.
    1 point
  23. If you outline exactly what you need maybe we can modify the Page Manipulator action, or create a new action designed specifically for deleting large numbers of users - I think this might be the best option. I am happy to build this if you mockup the interface.
    1 point
  24. @Mike Rockett I like the use of release and the changelog - please keep it up. In fact, I think I need to adopt this with my own modules going forward. It would be really nice if ProcessUpgrades - or the PW core - could send us to a module's release notes before we decided to update it.
    1 point
  25. Bumped to 0.4.0 Beta
    1 point
  26. Thanks Abdus, I checked all the permissions but could not identify any changes. However, when I said I had checked all the page 'family' settings I had omitted to check the 'home' page. When I did I found a list of 'allowed' templates which excluded the one I was trying to add. I have added it and all is OK - at least to that stage! With your advice I now have a better understanding of how this template process works - much appreciated. Many thanks, Michael (79 years young)
    1 point
  27. This week we're getting down into some of the smaller details of the Uikit admin theme. We take a look at that in this post, along with a couple of screenshots. Consider this a brief continuation of last week's post. https://processwire.com/blog/posts/more-admin-theme-updates/
    1 point
  28. When trying to modifiy a field of type Multiplier(V13) I get an error: Error: Call to a member function get() on null (line 317 of D:\Projekte\kopfleere\processwire-dev\www\wire\modules\AdminTheme\AdminThemeUikit\AdminThemeUikit.module) Line 317 states: $fieldset->collapsed = !$field->get('themeColor') && !$field->get('themeBorder') && !$field->get('themeOffset');
    1 point
  29. @Enrico or @moderators: I recommend renaming the title of this thread to something like: "Frontend editing and content creation possibilities?" Current title is not descriptive at all, that is why @Enrico The title can be edited when you edit your own post starting this thread.
    1 point
  30. Needed to show someone how to quickly setup some settings for various things in a simple text area: could be used for slider settings, site settings, etc; What it does: gives you a matching variable for each key of each line... 1.) setup a textarea field for the settings ; i'm calling it settings_ta 2.) add delimited settings, 1 per line; i use a pipe (|) delimiter; example: address|some info here facebook|https://www.facebook.com twitter|https://twitter.com phone|(999) 999-9999 3.) in your _init.php, get the settings - replace the page number and the name of your settings field: $settings_ta = $pages->get(1644)->settings_ta; $settings_lines = explode(PHP_EOL, $settings_ta); foreach($settings_lines as $settings_row) { $settings_pair = explode('|', $settings_row); ${trim($settings_pair[0])} = trim($settings_pair[1]); } more condensed version, for those of you who like brevity... foreach(explode(PHP_EOL, $pages->get(1644)->settings_ta) as $settings_row) { $settings_pair = explode('|', $settings_row); ${trim($settings_pair[0])} = trim($settings_pair[1]); } now you can do this in your templates: echo $address; echo $facebook; echo $twitter; echo $phone; Edit: made the code simpler....; 2nd edit - added trim to support using ace editor with tabs Addendum: as an added convenience, you could use the Ace text editor module which would give you a monospaced text field and the ability to use tabs for your settings, which could be more readable and easier to edit. The code has been updated to support this by trimming the exploded strings prior to generating the variable/value. address | some info here facebook | http://www.facebook.com twitter | http://twitter.com phone | (999) 999-9999
    1 point
  31. it might really need to be released as a whole new module as it is massively changed; for example, my version has 2 modules, one process module for setting up the fields and one that actually handles the object for providing the settings to the front end; has to be done like this if you want to give access to that settings panel to any other role besides superuser; Also, i think i tried to ask some questions to the original module author but they seem to be no longer around (mostly in reference to the major conflict the original module has with the $settings global variable which is also used by ListerPro).. The way i handle images is to have a page tree select where you select the page holding the image; this works well for me because most sites i'm building have some type of media library, so this allows users to select media pages containing stuff like logos, open graph fallback images, schema profile images etc;
    1 point
  32. @Macrura Thanks for the reply. It's good to know that you are having success with the module approach - I did take a brief look at it as I like the idea, but I ended up passing it over when I realised there was no support for images out of the box. Could you perhaps issue a pull-request to the module author with your changes? They sound like a worthwhile addition.
    1 point
  33. You can't enter a Hanna tag via the "Insert link" modal because the href gets entity encoded. But you can use a Hanna tag for generating the whole link: // Hanna tag "year_link", with attributes "url" and "link_text" $year = $pages->get('/settings/')->year; $href = $url . $year; $text = $link_text ?: $href; echo "<a href='$href'>$text</a>"; Usage: Please fill out this [[year_link url="http://www.somewhere.com/form1/" link_text="form"]]
    1 point
  34. Or check out the "Field List & Values" section of the PW Info panel in Tracy, which takes things a step further and explodes values which returns arrays (like images) and provides other details about the fields:
    1 point
  35. Nice one @Robin S, I've never seen that one used anywhere before. It seems to fetch all fields before handing you an ArrayObject. public function getIterator() { $a = $this->settings; if($this->template && $this->template->fieldgroup) { foreach($this->template->fieldgroup as $field) { $a[$field->name] = $this->get($field->name); } } return new \ArrayObject($a); } One thing that I'd like to have with explode() method is to get deeper fields with dot notation, such as $thumbData = $page->explode(['url', 'title', 'images.first.url', 'tags.count']); like underscore.php (or understore.js) does. I guess I should start building a module.
    1 point
  36. Not what was asked, but if you ever have a need to get all the field values and properties of the page in an array you can do this: $data = (array) $page->getIterator();
    1 point
  37. Simply put: a field is an interface to DB, an inputfield is an interface to user. One does not necessitate the other, but for some complex data types, you may need to build a custom inputfield (like MapMarker). If you're going to store information about multiple books on a single page, then you need to extend FieldtypeMulti class (FieldtypeEvents, FieldtypeNotifications, FieldtypeComments for example), to store information about a single book per page, you need to extend regular Fieldtype class (FieldtypeText, FieldtypeDatetime etc). If you want to allow more than 1 property to be used in selectors, then you need to use multiple table column in DB. This means you need to override getDatabaseSchema() method and specify a more complex table structure. Edit: Based on your description, you expose only one input to the user for ISBN/title, filling the rest is up to you (by fetching from a web service). You have two options: either fetch the data using fieldtype or using inputfield. Using inputfield to do fetch the rest of the data sounds more appropriate, because the purpose of the fieldtype is validation, formatting, sanitization querying and saving data from/to database, i.e. it only deals with the given data. An inputfield, however, collects and prepares all data that needs to be written to the database and presents it to a fieldtype.
    1 point
  38. My personal opinion is that database layers like dibi tend to make some things a little easier while making corner cases complicated and taking clarity away by re-using existing keywords in a sometimes non-intuitive way. Then, they don't support application features like PW's multi-language fields or status flags, so one has to reign in expectations. And, often overlooked, PW already has a nice extension to the DB layer in the DatabaseQuery* classes. Perhaps that should be put into the spotlight a bit more (and added to the API docs)? A working example: <?php $q = new DatabaseQuerySelect(); $result = $q->select('templates.name') ->select('count(*) as inuse') ->from('pages') ->join('templates on templates.id = pages.templates_id') ->where('templates.name != :tplname') ->groupby('templates.name') ->bindValue(':tplname', 'admin') ->execute(); echo $q->getQuery() . PHP_EOL; foreach($result->fetchAll(\PDO::FETCH_ASSOC) as $row) { echo $row["name"] . " => " . $row["inuse"] . PHP_EOL; }
    1 point
  39. Not "as if" but it is WireArray. No need to loop, just use the method ->first()
    1 point
  40. OK, so the host provider told me that I had done something wrong (had chosen the wrong server) when creating the database, then just a minute later they informed me that they have corrected the error. (?) This made it possible to log in to phpMyAdmin, and import my db without any problems, but the frontend was still inaccessible giving me 404 error (as far as I got it, it was some kind of mismatch between index.php and config.php). No magic helped there, so I deleted all the site files via FTP, then reuploaded them. Of course, here I needed to modify config.php accordingly (as I reuploaded a localhost installed site). After this step, my frontend came alive & working. Still struggling with some minor issues, but that is for another day.
    1 point
  41. I've just uploaded v1.6.1 that contains the CKEaddon config fix and also some minor AdminThemeUikit fixes. I've also modified ListerTweaks to allow empty asmSelects. I'm not sure about this line but I guess it's needed to clear previous lister sessions.
    1 point
  42. After my few years here, I'd never actually seen that tutorial by Joss, but was going to bring up his name when I saw this thread. In ProcessWire, the front end of your site is completely up to you. One of the things that does make WordPress appear simple is the availability of themes. The concept of themes is fine from one angle, but the implementation makes it difficult for novice users and non-coders, especially when you need to do complex work. This is where PW comes in. By not providing a theme framework, it gives you an opportunity to start from scratch and learn the basic easily, because every single aspect of the front end is up to you, and you're also aided by modules where the need arises. And, as has been pointed out, it's super-simple to get started with a basic site. The API is as simple and easy to grasp as they come. With that in mind, ProcessWire sites can be whipped up much faster than a WordPress equivalent and that's just the beginning.
    1 point
  43. Hey @tpr - any chance you could add the "Show pagelist actions on full row hover" tweak to the sidepanel tree - the one that shows when you click this icon in the breadcrumbs. I am starting to get into the habit of using that panel as a way to access the tree and I am really missing the full row hover. On another note - what are your thoughts on supporting the new UiKit theme now? It is starting to look more usable (although I must admit I still don't see any real advantages over an AOS tweaked default theme), but it would be a nice option to have going forward. No pressure by the way - I know it's going to become painful keeping up with three different themes. It will be interesting to see what happens - will UiKit takeover as default - will the others stop getting core upgrades? Comes back to my desire for one theme which is easily skinnable, rather than different structures!
    1 point
  44. New website for the Camel cigarette brand. When you enter you will see an legal smoking age alert in Spanish, please click on the lower right option "Soy mayor de edad, me registraré luego" (Legal age confirmation) https://camel.com.do Modules used: ProCache Croppable Image 3 Form Builder Login for Facebook ProDrafts Profiler Pro ProcessWire API Explorer Tracy Debugger ListerPro Redirects
    1 point
  45. Can we set up a Slack channel for Processwire? My key concern is to have ProcessWire stick around and look the part. I want my clients to easily find other devs, see that there is a team and a community behind ProcessWire and have it come across as a modern platform that will solve their business needs.
    1 point
  46. I am currently managing a PW site with 2 million+ pages. It's admirably fast, and much, much faster than any other CMS we tested. Searching is also ridiculously fast when done on single fields like title. (I also just did a test search using the page finder and it took < 4 seconds to find pages which had a particular field empty from a template which has 1.63 million pages.) The site doesn't deal with many image or file uploads (yet), but two optimizations I have applied so far are to 1) always, always use limits on using $pages->find(), and 2)to cache the sitemaps (which contain thousands of links each) using Procache(https://processwire.com/api/modules/procache/) Once you know where specifically your site is using the most resources, you can apply more selective caching / database optimizations. Thanks for starting this topic, I learned about pageFileExtendedPaths... there's always some cool feature I didn't know about and now must have!
    1 point
  47. if(strpos($q, " ") !== false) $q = str_replace(" ", "|", $q); $result = $pages->find("template=basic-page, title|body%=$q");
    1 point
  48. I finally figured this one out. I had just about given up, when I thought to look in config.php, and lo and behold, there at the bottom was $config->httpHosts, which only contained the domains that were working. I added the other domains, and now the multisite module is working excellently.
    1 point
×
×
  • Create New...