-
Posts
2,769 -
Joined
-
Last visited
-
Days Won
31
Everything posted by Martijn Geerts
-
It is possible I guess... If you hook to page::loaded, you can get the status and cache it to a variable. Then before pages::save you could check the status and role, when the status has changed, you could re-assign the cached status.
- 5 replies
-
- permissions
- publish
-
(and 3 more)
Tagged with:
-
PDF files as single Pages (Virtual file repository)
Martijn Geerts replied to Peter Knight's topic in Getting Started
With the extension, you can see from the page name it is a PDF. // So you can add a class my-pdf to our page PDF's with jQuery for example $("[href^='/downloads/']").filter(function() { return this.href.match(/.*[pdf]$/i); }).addClass('my-pdf'); And when you set a PDF header, browsers even don't know if it's not a real PDF. header("Content-type:application/pdf"); -
PDF files as single Pages (Virtual file repository)
Martijn Geerts replied to Peter Knight's topic in Getting Started
@peter For the title you can specify a pattern to force the pdf extension. ^.*\.pdf$ -
PDF files as single Pages (Virtual file repository)
Martijn Geerts replied to Peter Knight's topic in Getting Started
Looks fine to me ! And take a look at Soma's site. He has a post on flexible downloads -
FieldtypeSelectFile & InputfieldSelectFile
Martijn Geerts replied to Martijn Geerts's topic in Module/Plugin Development
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
Martijn Geerts replied to Nico Knoll's topic in Modules/Plugins
@Nico, I admire your beard! -
I love sheep...
-
@gemini, are you coming from MODX as you're naming context?
-
Copy button for multilingual content
Martijn Geerts replied to Juergen's topic in Wishlist & Roadmap
Copy sourcecode & paste ? -
1.2 milions pages and still running like a charm
Martijn Geerts replied to Raymond Geerts's topic in Dev Talk
And the rest in the beard ! -
https://github.com/ryancramerdesign/ProcessWire/blob/master/README.md
-
ProcessWire Module Generator
Martijn Geerts replied to Nico Knoll's topic in Module/Plugin Development
Just here to say: I like your tool Nico! -
@adrianmak, read this: http://processwire.com/blog/posts/processwire-core-updates-2.5.28/
-
It's rarely I build 'websites' with ProcessWire, most projects I've done this year are of the type application, tool or generator. It has taken a while before I recognised that the admin area is full of potential and could be easily used as starting point. The starting point in the admin is really well designed. You have the ability to hook, to build process modules where you want it, gain access access to or forbid. Easy implementation of Ajax, the ability to use Inputfields, Fieldtypes breadcrumbs tables etc etc and a wide variety of caching possibilities... The thing about everything is a page is a plus. Pages are API wise very well designed, you can use it and take advantage of it or drop it when you don't want to use them. When I have the option to use pages I will do it the pages way. If it makes more sense to go the plain SQL way you could go that way. But I do remember I mistakenly chosen SQL ones where pages were a way better fit.
-
There could be multiple valid reasons to use 'inline' javascripts. Going for an assumption based approach (as 'automaticly' placing before </body>) will steal some developers freedom. In my opinion: When developers want to use your module it's not bad they are following your instructions to make it work.
-
You quoted the instructions too
-
Determine old vs. new value of field when saving
Martijn Geerts replied to Jonathan Lahijani's topic in Modules/Plugins
Not tested but something simular would work I guess $this->addHookAfter('Pages::saveReady', $this, 'hookPagesSave'); public function hookPagesSave(HookEvent $event) { // Modified page, already contains changes in memory, not yet in DB $page = $event->arguments('page'); // If there is a change in your field if ($page->isChanged('name_of_you_field')) { // Page as it is in the DB $oldPage = $this->pages->get($page->id); // ... Now you could do your comparison old <-> new. } } -
I also think allowed characters for MySQL table name is a limiting factor here. I do think ProcessWire shouldn't allow you to use dashes. I posted this on github so Ryan take notice.
-
Yep possible, what I sometime like to do is prefixing my template names. For example: $templates = $this->templates->find("name^=element_"); and then returning all templates starting with element_. This will save me from 'forgetting' to set family settings & i'm lazy You could write an autoload module and Hook to: $this->addHookBefore('ProcessPageAdd::getAllowedTemplates', $this, 'beforeGetAllowedTemplates'); public function beforeGetAllowedTemplates(HookEvent $event) { $parent_id = $this->wire('input')->get('parent_id'); $parent = $this->pages->get($parent_id); if (!$parent->id) return; // As it is a before hook, replace it $event->replace = true; $array = array(); // All templates starting with name element_ for example $elements = $this->templates->find("name^=element_"); foreach ($elements as $template) { // Do your dingdingdong $array[$template->id] = $template; } $event->return = $array; }
-
@berechar, Not possible out of the box, you need to build a module for that. The good thing is I have a gist that does bidirectional save / remove for 2 pagefields and 2 templates. You have to change the hard coded values in that gist or B) write a proper configurable module for that. (Code a module for this? someone? me not having much time, sorry )
-
@austin11 I see no value for ProcessWire in your post Next, you're linking to commercial websites in your footer.
-
Nice site ! One thing: Mobile menu fails when you narrow the browser window from desktop to small screen (no click assigned or something).
-
I like it !!!