-
Posts
2,765 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
yeah, the NEW process hello (which is kind of different than the old process hello) is what you were talking about, the new one creates the admin page etc.. now i just need to refactor the code on my admin pages, which are mostly special tables of pages using jquery datatables, showing various fields, sometimes calculations, related pages, alerts about images being too small, and edit buttons...
-
@apeisa, thanks - working on it now.. gonna be tricky though to refactor all of my code, i have a lot of admin pages that are using simple templates with mixed html/php.. really wish there was a better/simpler way to just have the Admin Custom Pages module work with the new admin theme module, without having to modify the index.php ... yeah - sorry about misspelling your handle!
-
i have also had to do this in order to make my custom admin pages work... wish there was a better way though.. @Soma - can you explain more, or perhaps post an easy way to make a custom admin page? I use diogo's module on a few sites but now i have to change the index.php, as above, i couldn't figure out how to change the ACP to use the admin template module.
-
it would be very easy to add a hook and do this; i've seen sample code here on the forum. you would hook into the page saveReady public function init() { $this->pages->addHookAfter('saveReady', $this, 'autoIncrememt'); } public function autoIncrement(HookEvent $event) { $page = $event->arguments[0]; if($page->template != 'someTemplate') return; // some logic here to count the existing pages of this template and then add 1 and set the value of your auto increment field to that value, if it is empty. }
- 5 replies
-
- auto increment
- user
-
(and 1 more)
Tagged with:
-
this is also interesting: https://www.yootheme.com/component/blog/2013/08/13/how-big-is-uikit
-
hey - thanks everyone for taking a look; a lot of fun processwire stuff going on under the hood with this one; - every object (news, release, event..) has a page select for the works list which is a database in an unpublished part of the tree; then when outputting the works list it checks for references and links to those; the 2 column works list is output using selectors for the century (work_year>1999) and the category.. - the fractals page uses tags on the audio and image files to find matches and associate the audio file onto the image; - other use tags to define galleries, teaser images; - maps plugin used for event locations and then build URL to google maps from the map marker module vars; @David - your AIOM saved the day as far as dealing with all of the jquery/css files from the multitude of jquery addons..!
- 10 replies
-
- 1
-
- showcase
- responsive
-
(and 1 more)
Tagged with:
-
Just deployed a new PW site for a contemporary classical composer: http://www.jonathandawe.com/ AIOM Formbuilder ProCache Redirects MapMarker ImportPagesCSV MarkupSimpleNavigation Hanna Code Version Control Audio plugins used: Soundmanager2, 360 player with visualizer Fancy Music Player And thanks to the combination of AIOM, Procache and Cloudflare, the site seems to be very fast, gets a yslow of 96-98; Homepage Here is the sm2 circle player example with vis, overlaid on a relevant image: [goodbye joomla....!]
- 10 replies
-
- 17
-
- showcase
- responsive
-
(and 1 more)
Tagged with:
-
i use this, which was posted by willyc somewhere, just pulled it from my code snippets: what.i use this is good it does.work top {not buttock}, of htaccess u will.put it . enjoy <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/octet-stream "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" </IfModule> <IfModule mod_headers.c> <FilesMatch "\\.(ico|jpe?g|png|gif|swf|woff)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch> <FilesMatch "\\.(css)$"> Header set Cache-Control "max-age=2692000, public" </FilesMatch> <FilesMatch "\\.(js)$"> Header set Cache-Control "max-age=2692000, private" </FilesMatch> <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary: Accept-Encoding </FilesMatch> Header unset ETag Header append Cache-Control "public" </IfModule> <IfModule mod_deflate.c> AddOutputFilter DEFLATE js css AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </IfModule>
-
@Joss, i have a similar question... need to start a new project and want to use a framework; Strongly considering foundation; have used Skeleton and Bootstrap a lot; I played around with uikit at bit but haven't formed a strong opinion yet, but it does look nice, and that's the people from yootheme whom you might be familiar with from their template clubs for joomla and wordpress;
-
i do this sort of thing now a lot, thanks to Ryan's CMS Critic Case Study; this is almost the same as WillyC's code at the above link /** * This hook modifies the default behavior of the Page::path function (and thereby Page::url) * * The primary purpose is to redefine blog posts to be accessed at a URL off the root level * rather than under /posts/ (where they actually live). * */ wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->template == 'post') { // ensure that pages with template 'post' live off the root rather than '/posts/' $event->replace = true; $event->return = "/$page->name/"; } });
-
@MarcC - wordpress with ACF gives a little % of processwire feel; custom fields and api to get the data; on the rare instance i use WP, i'm always using ACF..
-
@landitus, in my case i'm generating the page name initially because that will be overwritten when the person changes the fields on the page; in this case it's more of a database entry and not a page on the site. to change the page name and title on save (from a combination of fields) i use a module that was also demonstrated by Pete called 'buildUrl' i think and then i expanded it a lot
-
I think the issue here is that the Admin Custom Page module is not aware of the new admin theme being in a module, so your custom admin pages still retain the non-module theme. We'll have to take a look at the code and see if there's a way to make some adjustments to how the module loads the theme.
-
right - thanks - i'll look at how you did the save alert module, should be able to figure it out; also i wonder if there is a place where could be stored a collection of utility modules for devs; basically they wouldn't do anything out of the box but provide infrastructures for building stuff - so you would have to edit the code for your use, rename etc.. examples would be modules that auto-build URLs for certain templates, add js or css to admin screens, auto-add new pages without having to name them first; these are some things i'm using on a current site, and that i've seen a lot of posts related to; but there's really not centralized place where they are available... i guess they could be in modules directory as proof of concept or building blocks, with a disclaimer that they don't work without modification and shouldn't be installed on a live site..
-
i'm trying to make a simple module to add various scripts to the page editor in the admin, for different templates. class customAdminScripts extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Custom Admin Scripts', 'version' => 100, 'summary' => 'A module to inject custom javascripts.', 'href' => 'http://www.processwire.com', 'singular' => true, 'autoload' => true, //'autoload' => "template=camp", ); } public function init() { $this->addHookAfter('ProcessPageEdit::execute', $this, 'addAdminScripts'); } public function addAdminScripts(){ //if($page->template != 'camp') return; $this->config->scripts->add($this->config->urls->customAdminScripts . "customAdmin.js"); } } how would i set this up so that i could add specific scripts to certain templates - right now i can only get it to work how it is now, loading on all templates
-
thanks Soma! i was working on an export function sort of like this yesterday - this will help a lot!
-
no i mean i don't have any old versions around on my hard drive; when upgrading sites i rename the wire directory to _wire and then put in the replacement, just in case i have to revert
-
right - actually i'm not sure if i have that... i tend to overwrite my dev versions with the latest when i download them... it's not a huge deal except for the fact that i was using fontawesome on these custom pages and that no longer works.. i did try copying the admin-templates from the wire into the site, directory to see if i could get the fontawesome to work.. guess i either need to deal with it for the time being or revert to the old theme by uninstalling that admin theme module
-
ooh - thanks Manfred62 - yeah let me see if i can uninstall that; thing is that i do like the new admin theme etc.. but might need to wait for diogo to update the admin custom pages to work with this new setup!
-
with the new way the admin theme is structured as a module, it seems that if you are using the admin custom pages module, the module isn't aware of the locations of the new admin theme files, so it still uses the old default theme; so i'm just wondering - how can I either switch the admin theme to the classic old theme, or has anyone figured out how to make the admin custom pages module work with the latest dev, using admin theme module.. TIA
-
I'm using pete's example code here, but i added a lot of stuff for my use case, but it's basically this: http://processwire.com/talk/topic/1648-ok-to-change-page-name-path-after-save/?p=15232
-
@pete - many thanks for your example; i used your code and made a module, and this works really well, eliminates that first screen and auto-generates the page name as the id; i'm also using another example you posted to then build the name from various fields, once the user clicks save..
-
@diogo - this is more of a status report - using the latest dev, where the admin theme is now module, the custom pages still use the old default admin theme.. cheers, marc
-
that's exactly how i did the Ohm Speakers store, and also another shop i'm working on; i like this approach the best if the child products have a lot of their own images, and individual data/specs. if it were a simpler product then repeaters would probably work ok and maybe be easier for the end user to understand..