-
Posts
1,011 -
Joined
-
Last visited
-
Days Won
8
Everything posted by SiNNuT
-
I'm not quite sure what you are getting at by the virtual part but it is possible since a while to have users under different parents. http://processwire.com/blog/posts/processwire-core-updates-2.5.14/
-
To answer: definitely possible. https://www.tripsite.com/ is quite a big tour site powered by PW, with bookings availability etc, and developed by Ryan. I'm not sure if there is some kind of case study anywhere or maybe Ryan has some pointers if he reads this.
-
This is becoming more and more impressive and useful with each update! Great stuff. On of my most used modules.
-
You mean via a backend module interface instead of doing it in the module code? You could make a configurable module. See https://github.com/ryancramerdesign/Helloworld for an up to date example.
-
Just a quick response. I'm not aware of any 'out-of-the-box' solutions but it would be easy enough to come up with a small module for this. There are some threads about this on the forum, with code that you can almost use as-is or adjust to your needs: https://processwire.com/talk/topic/4201-how-to-automatically-set-the-value-of-a-field/ https://processwire.com/talk/topic/2331-doing-additional-logic-after-saving-a-new-page/ Maybe others will have other suggestions.
-
How to export all user emails to a CSV file?
SiNNuT replied to Vineet Sawant's topic in Getting Started
Normally you don't need start=n, or even you shouldn't use it. http://processwire.com/api/modules/markup-pager-nav/ -
Checked on smartphone and ipad and everything is looking great. I really like the design and the way the information is presented.
-
Always call/open the first found child url instead of parent url
SiNNuT replied to Bacelo's topic in General Support
So where you able to implement it to what you needed? Because i could not quite get the intention from the code you posted. -
Always call/open the first found child url instead of parent url
SiNNuT replied to Bacelo's topic in General Support
Do you mean some form of 'first-child-redirect'? So when you visit Parent 1 you are automatically redirected to Child 1. Put this on your Parent 1 template file. <?php /** * Template: First Child redirect * */ if($page->numChildren) $session->redirect($page->child()->url); taken from: https://processwire-recipes.com/recipes/quick-first-child-redirect/ -
I have no clue and try myself atm, but: -does it make a difference when you add a space between the width and the height, so size(300, 300) -does the image variation already exist on disk? Maybe the chaining does not work when it doesn't. - What if you do something like $variation = $img_src->size(300,300); echo $variation->url;
-
I would suggest you study the template files that come with one of the PW default profiles. There is a lot there to learn and also stuff that easy to copy paste and adjust a bit to your needs. Taken straight from _main.php of the of site-default: $homepage = $pages->get('/'); //this comes from _init.php <ul class='topnav'><?php // top navigation consists of homepage and its visible children foreach($homepage->and($homepage->children) as $item) { if($item->id == $page->rootParent->id) { echo "<li class='current'>"; } else { echo "<li>"; } echo "<a href='$item->url'>$item->title</a></li>"; } // output an "Edit" link if this page happens to be editable by the current user if($page->editable()) echo "<li class='edit'><a href='$page->editUrl'>Edit</a></li>"; ?></ul>
-
Template 'Name format for children' expansion
SiNNuT replied to SiNNuT's topic in Wishlist & Roadmap
If you have pages setup for the 1 step page creation and you have title set as format, at first it will make the name 'unpublished', 'unpublished-2' etc. It updates when you fill the title and save the page. The same route could be taken for other fields than title. I must admit that i don't use the format option a lot, i don't know about the general PW public. -
Currently the 'Name format for children' setting is limited to: alphanumeric: 'test', will turn into 'test', 'test-2', 'test-3' etc. title: name will be based on the title once filled in (at first it will make the name 'unpublished', 'unpublished-2' etc.) date: the addition of any non alphanumeric character (including space) will cause it to be interpreted as date. So entering 'test more' will lead to some date string that doesn't make sense If possible i would like this to be made more fool-proof. But ideally i would like the 'Name format for children' to have more options. Like combining the different options and maybe be able to choose from more fields, apart from title. I also think that in cases where you want to auto-populate the name you often don't really care about the page title as well. So it would be cool if one could auto-populate a page title (and maybe other possible global required fields) as well. If the format would allow for date/timestamp, fieldvalues, text and combinations of those it would be really powerful. Also probably a lot of work but it's a wish-list after all
-
custom php code to find selectable pages + autocomplete
SiNNuT replied to bernhard's topic in General Support
If it explicitly states that it is incompatible with certain Inputfield types the behavior can hardly be described as strange. Maybe in your case it does work somewhat because of the type of custom PHP code, but don't expect it to work in every situation. Although it would be nice if it could, i agree. (If we are talking about a default install here i seem to remember that the sitemap page has the 'hidden' setting turned on. Maybe this leads to PageAutocomplete to not show it.) -
// on home.php $fonts = $pages->get("/fonts/"); //on fontlist.inc $fontlist = $fonts->find("id>1, limit=6, draft=0, sort=name"); // so this is nothing else than $pages->get("/fonts/")->find("id>1, limit=6, draft=0, sort=name") //which is the same as: $pages->find("parent=/fonts/, id>1, limit=6, draft=0, sort=name") //and thus works as expected, and i don't think you need the id part of the selector For the keyword pagination the page count seems alright but you get the same fonts on all page numbers. Correct? I think this has to do with the fact that you already do a find in keyword.php: $fonts = $pages->find("keywords=$page"); And you then include fontlist.inc which you again feed $fonts $fontlist = $fonts->find("id>1, limit=6, draft=0, sort=name"); I can see how this could go wrong, see http://processwire.com/api/modules/markup-pager-nav/ , under " Are there any side effects" Edit Too late again, don't be grabbing some coffee before writing a post Maybe my conclusion was wrong also
-
That is strange, i don't see anything wrong with your query. When i run it on my two-row table it works as expected. UPDATE mytest SET mytext = REPLACE(mytext, '<p> </p>', '') Result, 2 rows affected<p>This is a test</p><p> </p><p>Cool!</p> after update: <p>This is a test</p><p>Cool!</p> <p>Another test</p><p> </p><p>Cool!</p> after update: <p>Another test</p><p>Cool!</p> EDIT For you second question: I'm sure that you've already Google'd it yourself but MySQL does not seem to support regexp based replaces. So unless we're lucky enough to be running on MariaDB https://mariadb.com/kb/en/mariadb/regexp_replace/ , the fastest way i think is to just dump the database and perform the regexp replace with a different tool/php/mariadb.
-
You can re-use page fields as many times as you want. If the content of the summary field suits your needs you can also echo it in other parts of the template file (or _main.php) . For it to be visible 'onscreen' it needs to be output somewhere between the html body, in a place of your liking.
-
Over time we have often had discussions about the nature of Pages and the fact that the term 'Pages', in context of ProcessWire(PW), can be misleading. Pages can represent a lot of things and serve multiple goals. (fun read: https://processwire.com/talk/topic/2296-confused-by-pages/ ) You are right that Pages can be seen as (URL accessible) data objects. What data a particular Page can hold is defined via the page his Template and the Fields added to that template. So a Template can, amongst other things, be seen as a data model. ProcessWire has its own way of organizing and relating data. While the underlying database structure might be different than most MVC-ish systems, the Page tree and the Page fieldtype allow for really flexible ways of achieving most, if not all, of the traditional model associations like in Rails' Active Record. Finding and working with pages/data couldn't be easier thanks to the great API, so i don't think there is a need for an 'ORM' because in a way PW already has this.
-
Remove (disable) invalid attributs of tables in CKEditor
SiNNuT replied to Juergen's topic in General Support
If it works (can't test) it would be best to add those settings to the site/modules/InputfieldCKEditor dir. Nice stuff, because the table plugin always bothered me. -
I was a bit confused at first because i did not see the update on the 'official' Github repo (apeisa/Multisite). Wouldn't it be worthwhile to add this to there?
-
Generally, if you output stuff in a template file that comes from the PW backend, you don't have to manually sanitize or escape anything. PW's fieldtype/inputfield takes care of a lot of stuff and for text and such you just have to set the correct Textformatters on the fields. It's when you start taking in user input from outside the PW admin that you should sanitize stuff. So when you just echo a pagetitle in a template file there is imo no need to use sanitizer.
-
Have you set the image field to single image?
- 10 replies
-
- 1
-
-
- css
- image field
-
(and 1 more)
Tagged with:
-
Alternative to creating pages for temporary data storage
SiNNuT replied to Vineet Sawant's topic in Getting Started
Uh no, diogo was talking about something different than the admin notifications. That's actually what i was talking about. PW has notices (core/notices.php) and the more advanced SystemNotifications, available in dev but uninstalled by default. -
Alternative to creating pages for temporary data storage
SiNNuT replied to Vineet Sawant's topic in Getting Started
It's a little hard to tell exactly how you want these notifications to work but i think the relatively new System Notifications module could be a good fit. For now it is only available on the dev branch: https://github.com/ryancramerdesign/ProcessWire/tree/dev/wire/modules/System/SystemNotifications But in the soon to be released 2.6 it will be included i think. There isn't any formal docs yet but you can study the code and read a little bit about it here: https://processwire.com/blog/posts/processwire-2.5.3-master-2.5.4-dev/#whats-new-on-the-dev-branch