-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
I'm not sure I understand correctly. "My" approach already does exactly this. The template in PW uses all "main" as alternative, but the template name still exists when main.php is called, so depending on the name of the template the right templatename.inc view include will be loaded. -
THis has been reported already, it seems a bug, fieldsets don't work in custom tabs.
-
Hi ceberlin, thank for your post. Do they have cURL enabled? We could then implement to use it if allow_url_fopen is disabled. I think in case this doesn't work out it could be a simple download link to download and intall it manually.
-
I always use an exit() or die(); after the echo echo $variation->filename; exit(); Ryan the extra "." in the thumbnail filename PW is generating. saskia-smaller.0x100.jpg
-
Maybe some code injection on where they get deleted in Pageimage.php to see if name and paths are correct will help.
-
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
Ah, yes then you would have to include the function to each template file. That's one reason I don't like Ryan's approach. Though no issue at all, just personal preference. Edit: Yes a module would help here, that provides function for all templates. -
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
Of which method here are you talking about. With my approach the main.php always get's loaded and then the template of the page is included, so this will work well. -
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
I'm not sure I understand right, but I would put them in main.php or include them like you would when using a head.inc. -
If you're speaking about Cropimages (module), yes the cropped images won't get deleted. If using regular Image field in PW, the thumbnails will get removed.
-
I think maybe my ColorPicker modules would be good reference to make it. http://modules.processwire.com/modules/fieldtype-color-picker/
-
It's simple and possible to add a custom js to load on page edit. Then the script would listen to the field input and handle the showing of the video. A regular field (text) would suffice, you then need to look at the admin code what class or id you have to attach you're scripts to. If that's what you're after you can maybe make it a simple js module or an autoload module that hooks in after Page::edit or something similar. Let us know so we could sure give you more detailed help to get you started. Edit: of course nothing again creating a simple fieldtype/inputfield module that would be more flexible and dedicated, but little more complex.
-
Hmm. I used double click feature in jstree http://www.jstree.com/ in a project and I think it's done using dblclick event. Never noticed any problems.
-
I think everybody thought about this. SInce I use delegate approach, one main.php that "all" templates use, I have a include to /views/basic-page.inc so it's pretty nice. More possibilities are there using includes.
-
Thanks Ryan! Well he mentioned it on IRC, so I remembered to split it up so it works from a forum post.. not sure it really was about the exactly same, but order of selector fields matters. Some things he recognized he make a post you even liked.
-
Good thoughts. I think the same. Though our clients don't have any problems understanding without anything (default theme). BTW my theme goes the same direction http://modules.proce...odules/teflon/. I think making it possible is nice, although I maybe won't really use it. Depends on the project.
-
If you're fine with updating it with every PW core update, yes.
-
You can since latest version of InputfieldTinyMCE add custom plugins from within outside core. It has a field "Third Party plugins" you can enter name and path to plugin , and put plugin for example into a folder /site/tinymce/... I'm not sure about adding it to the core. Since it also is a browser feature, and the plugin doesn't seem to have localized feature (most important)
-
You can also uninstall, change and install to change it. It doesn't change DB when only changing module code "autoload" => false,
-
No, there's no way to exactly define order, but if done right it should load after jquery core. Can you show full module code? It depends on more than just the init. What type etc... Edit: Also see here : And here : And here :
-
I tend to use http://caniuse.com or the list interobang posted. Thanks for tips, I'm sure someone find them interesting. BTW now you only need a more clever post title
-
It is already double click to edit. If you train some you get pretty fast with it.
-
I think it would be possible merging 2 results, but it may not as optimized loading the page array ( though not whole page object ) for thousands of pages. But if it's not 100'000 I think it should work. Also it would be possible to create a pagination by hand. On the other hand building sql queries aren't really save maybe but can be most optimized choice. Though what you could do which would be as optimized is use a hidden field on template so store parent title. Create a autojoin field "parent_title". Then populate that field using a hook module. Then you can do: $results = $pages->find("parent_title|title%=searchtext"); So you could write and autoload that stores the parent title on page save or move and parent save to update all children pages. Also a bootstrap script that you can update after changes or a lazy cronjob or cronjob that update's all in one call (all parents children)
-
But this really works, there's no bug here: $allResults = $results1->import($results2)->sort('-modified')->find("limit=5"); Do you mean with making it one selector? This has never worked I think, also MadeMyDay has found about it some time ago.
-
Would this makes sense or even easy possible to add a property, so you could simply check in moules/templates if you're in admin or frontend using: $config->isAdmin; Something like the $config->isAjax; If not, so those are the common checks that can be used to determine this (for reference): if( wire("page")->template == 'admin' ) { // is in admin } if( wire("page")->template != 'admin' ) { // is frontend } if( strpos( $_SERVER['REQUEST_URI'], wire('config')->urls->admin) !== false ) { // in admin } checking for only certain admin processes or areas is also possible // in a autoload module you could also use if( wire("process") == 'ProcessPageEdit' ) { // is editing page } if( strpos( $_SERVER['REQUEST_URI'], wire('config')->urls->admin . 'page/edit' ) !== false ) { // in editing page }
-
While testing this again, noticed a problem with my flourish include in the header.inc. Defines function like this: <?php // include flourish lib function flourish_loader( $class_name ) { // Customize this to your root Flourish directory $flourish_root = wire("config")->paths->root . '.libs/flourish/'; $file = $flourish_root . $class_name . '.php'; if (file_exists($file)) { include $file; } } spl_autoload_register( 'flourish_loader', true ); When the preview popup loads, it throws an Fatal Error, that the function is already defined. Somehow it renders or loads the page 2 times it seems. Not sure where this comes from, and if this could lead to problems elsewhere too. However to avoid it one can write the flourish include like this (for reference) <?php if( !function_exists(flourish_loader)){ function flourish_loader( $class_name ) { // Customize this to your root Flourish directory $flourish_root = wire("config")->paths->root . '.libs/flourish/'; $file = $flourish_root . $class_name . '.php'; if (file_exists($file)) { include $file; } } } spl_autoload_register( 'flourish_loader', true ); Still my #2 still persists. When I change text on page and hit preview it doesn't show changes. Only after I close and click preview again it show the changed text.