joer80
Members-
Posts
364 -
Joined
-
Last visited
Everything posted by joer80
-
The page tree would be something like: Page 1 Page 2 Theme The gist I was playing with was each page would have a ace rich text box with css in it. On page save it would grab all css from all pages and save to theme. The theme page may want to add to it also though. May have to keep thinking this out. I will make it spit out a css file from that cached field that holds the total output. Add a timestamp for cache busting and have my Page template link the most recent file.
-
I thought about doing this: if($page->id == $_GET['id']){ $OtherPage->save('ThemeCachedCSS'); //only save the one field instead of whole page } The admin page save click would work because the get var would be set to the page you are on, but it wouldn't loop because the api call page id would be different. It would still loop when editing the theme page though. You would always need it to be a different page than the one you are on.
-
Very nice idea!
-
Ah, I see you posted before me! Thank you for all of your help!
-
Do you think this is a good way to approach the problem? Or do you know of a better way? public function init() { $this->pages->addHookAfter('save', $this, 'UpdateAnotherPage'); //save, saved, saveReady, saveFieldReady } public function UpdateAnotherPage($event) { $page = $event->arguments(0); //Update Another page $OtherPage = wire('pages')->get('id=1240'); $OtherPage->setOutputFormatting(false); $OtherPage->ThemeCachedCSS = '123'; if($OtherPage->ThemeCachedCSS != '123'){ $OtherPage->save(); } }
-
Ah, so I need to figure out how to make it only save the first time!
-
If I run this, it only shows the message one time if I save one page. public function UpdateAnotherPage($event) { //Show saved message $this->message("Save Ran"); } I know the code is bare min and doesnt look useful right now. I did that to make it easier to figure out. I can edit any page to see the bug. Hope that makes sense and I am not misunderstanding.
-
I have a module that is not working and I cant figure out why. When an admin page is saved, I want to update another page. This is my code: public function init() { $this->pages->addHookAfter('save', $this, 'UpdateAnotherPage'); //save, saved, saveReady, saveFieldReady } public function UpdateAnotherPage($event) { $page = $event->arguments(0); //Update Another page $OtherPage = wire('pages')->get('id=1240'); $OtherPage->setOutputFormatting(false); $OtherPage->ThemeCachedCSS = '123'; $OtherPage->save(); //this breaks it } It will save the data in the new page, but the admin page doesnt load, it tries to load my homepage. If I comment out the ->save(); line, it stays on the admin page and says page saved, but just doesnt update the other page. I am probably missing something simple! Thanks!
-
I have a text area on a template that stores html. I think it would be a great addition if we could make the page save feature keep my spot in the text area and keep the spot of the scroll bar instead of taking me to the top of the page and starting the text area at the top. (I could have been editing a line in the middle of the box and then need to scroll down to find it again to make another change) Even better would be an update that wouldn't refresh the whole page at all but just the field contents! But a flash is ok as long as it remembers where I was at!
-
Anyone had an issue with it getting stuck in satellite mode? (On the admin side and on the front side?)
-
Band wants to charge $1 for song downloads online
joer80 replied to joer80's topic in General Support
Great suggestion! If they are on a tight budget, I might fall back to that as a cost effective option! -
Band wants to charge $1 for song downloads online
joer80 replied to joer80's topic in General Support
So using padloper, the credit card would be entered in on my website, even if I used something like paypal as the payment method? Does that add any extra pci hassle vs doing something like foxycart where the creditcard is entered in on their servers and they connect with paypal? -
Band wants to charge $1 for song downloads online
joer80 replied to joer80's topic in General Support
I will take a look! I mainly listed price in case there were some kind of micro transaction service since some have a minimum per transaction fee. I would love to find there was a mostly put together way to do this! Instant digital download would be a must at such a low price! Too much labor to send links. -
I have a music group that wants a website but they want to add some of their music for free, and some of it as a paid download for $1 each. What would you guys recommend on tackling this situation?
-
Those are helpful links. It appears it is not something processwire is doing so much, it just changed the default location for what php already does. I would guess the files are necessary for allowing php to save session variables and deleting them would be bad. If so, I would want those to last 24 hours and do not think it would be a good idea to shorten their lifespan. If it were a garbage collection issue, I would think they would be not clearing out everyday. I think websites with a lot of traffic may benefit from having them saved in the database though to save inodes. Even downloading your website via ftp would be a hassle with it this way. It is easy to get around by compressing the website and downloading that file though.
-
I noticed there were 10k files in my site/assets/sessions folder. It does not appear they are older than 24 hours. Is this normal? Do they auto delete and refresh every day? Thanks!
-
Great, thanks!
-
I was able to fix my issue with this change in the MediaLibrary.module file. Change: public function ___getPageMediaLibraries($pg) { $libraries = array(); foreach($pg->parents->and($pg) as $ppage) { $libraries = array_merge($libraries, $this->getChildLibraries($ppage)); } return $libraries; } To this: public function ___getPageMediaLibraries($pg) { $libraries = wire('pages')->find("template=MediaLibrary"); return $libraries; }
-
I am having an issue where it works if I put my MediaLibrarys at the top level, but if I make a Regular page Called "Media" and create them under that, it no longer works. The drop down is just empty. ie. /media/people/ (People is the MediaLibrary page) On the admin/media page it does correctly show the path as: Pages / Media
-
Is it possible to make the admin page tree fully expand each child by default if you click page? Thanks!
-
It appears to be working if I install the admin restrict page tree module, and create a new role that can edit pages, but can not see the page tree, and gets forwarded to Access -> Users page upon login. Automatic
-
Will that take away the ability for them to mess with templates?
-
How hard is it to setup a user role that can edit and add user accounts, but not edit anything else like the page tree or templates?
-
This would have also worked: $csvPath = '../..' . $m->csvFile->url; Instead of $csvPath = '../..' . $this->config->urls->files . $m->id . '/' . $m->csvFile; Its just important that you add the '../..' since the fopen will not find the file without it.
-
If I decide to go json way, would this be the most up to date method to go with? I dont see a service pages module any longer.