-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Maybe this custom upload script example does help?
-
Thank you guys. Yes I love doing the simple things and I loved to cheat in school. Anything more than list causes me headaches.
-
Captain Hook ProcessWire Hooks Cheatsheet http://somatonic.github.com/Captain-Hook/ or on processwire.com http://processwire.com/api/hooks/ I created a simple list with a live search for all hookable methods available in the core. All methods prefixed with a "___" (3 underscores) are hookable. Methods can be made hookable by simply adding those ___ to it. ------------------------- I usually don't really need this, but thought it would be good to have an official list for reference. I used Sublime Text2 for searching and dumb a file with a search for " ___" in wire core. From this list I created a html file with a php script and added some fuzzy live search, similar to the API cheatsheet. If you use Sublime Text 2 like me you can simple use Goto Anything command super+p to show a fuzzy search for files. Enter a class name you want to search for. For example "fields" or "process page edit" you will recieve a list of files found in PW. Highlight the file and typ a @ to see the symbol list quickly or select the file and super+r the get the symbol list.
- 52 replies
-
- 23
-
don't want create images with GD-lib, - and some more needs
Soma replied to horst's topic in General Support
Any method in the core with 3 underscores prefixed can be hooked. Looking at ImageSizer.php there's none in there. -
All methods in core prefixed with 3 underscores can be hooked by className::method.
-
$page->field->clearAll(); Or was it removeAll();
-
Ah then I didnt really get what the desired result was. Nevermind. I think nik is spot on here. You can easily get top of all repeaters and if you add limit to the selector it will be good. Yeah the doublicates youd have to work out if there could be any at all.
-
Look for my ChromePhp debug module. If you want from start to end of full pw youd have to insert your code in top and bottom index.php gateway. No way to hook that obviously.
-
Similar to Repeater - Custom Fields not fixed to template?
Soma replied to nexflo's topic in General Support
Repeater field is the only option currently. Maybe in future we could try building something out of it to support many repeater templates you could define and choose from when adding new item. Originally this was my idea to have with how repeater work but it turned out different. It's very complicated to build but it may worth trying. We already discussed this and people where asking for it. For now page references work pretty well and is the way to go as it offers the most flexibility and enables to share content and reuse. It's consistent abd fast. Rather also see how far we could push page fields to add features like direkt editing etc. -
First Year Programs at the University of Washington runs on ProcessWire!
Soma replied to Jennifer S's topic in Showcase
Hey Jennifer, nice site and design! Congrats and great to hear your opinion on PW. Some little things I noticed: Just noticed something when on mobile landscape mode I see a responsive layout broken a little. It looks like this: Clicking Calender of Event on home does to a 404. All the links from the top carousel go to a 404 to http://fyp.washington.edu/fyp I took a closer look at your site and seeing the home page has a impressible load, 85 files and 2.7mb just for what is there. And it's strange as it seems something is loading scripts multiple times as I don't see (just looked quickly) where it's coming from or why at all, so modernizer is loaded twice etc. There lots of css and js script and plugins and fonts, I wonder how much you could improve that without going mad. One of the reason I always still build my custom css and js and only use plugins when really needed, also a reason I don't like those full blown frameworks. Looking at the mobile perspective you load the full images you won't ever need that big anyway so a adaptive image solution would also help reducing page load. Just my 2 cents. -
I have created a sample module that does mapping two page fields against each others As per http://processwire.com/talk/topic/2384-change-the-value-of-one-field-by-editing-another-one-possible/ https://gist.github.com/somatonic/4335296 I also have a rough module that adds links to the pages linked after saving, but it's not something I can share. But looks like it's not what you actually ask for, but anyway all is possible.
-
Happy discovering. It's like christmas just more useful.
-
I created another version to show how to create this navigation with post which have a date with daytime. So it covers a range of 24 hours and not only a date without time. It looks for the next post found in future and past, so it will still work if there's a day in between where no posts are published. I created a new gist snippet for anyone interested as reference: https://gist.github.com/somatonic/5068777 It will give you something like this
-
Now tested and put the code on gist github: https://gist.github.com/somatonic/5067314 I have some minor correction and added comments, some improvement to show how to handle 404 and dates.
-
You'll have to adapt it to your situation and test it out, that's all I can do.
-
Posting code to github gist... Much easier here is the code: https://gist.github.com/somatonic/5067314 Something to start with and think about , not really tested and sure about the date to compare with publish_from=$prevday as those will be timestamps, but you could convert them first. Just tested a little around and cleaned up script and added comments.
-
There's million ways to, but I think you first need to make clear what url you'll need to display the post of today or any day when you go next or previous day. I don't know the blog profile much. How is the category the $page? Are you on a category page when you want this to display? I don't think prev() next() will work here. I think best is you would use url segments, so you would have like /posts/today, /posts/dd-mm-yyyy But where is the category coming from then?
-
IT would help greatly to see a example what you want to archive exactly AND what the structure is you have with "posts".
-
Examples? Any code yet? Paginate? Do you mean with pager? 1 | 2 | 3 ? Or simply with $page->prev() $page->next() ?
-
Creating content in PW API is as simple as it can get. First we want to create a new Page object, then fill some properties and give it a template, parent and a title. Now save it. Or to modify an existing, you can simply load a page with $pages->get(id|path|selector); and change properties and save it back. In praxis this basicly looks like this from within a template code: $mypage = new Page(); $mypage->template = "basic-page"; $mypage->parent = $pages->get("/"); // root $mypage->title = "My New Page"; $mypage->image = "http://www.some.com/img/myimage.jpg"; $mypage->body = "Hello World"; $mypage->save(); Or within a php file bootstrap of the PW index.php, ( or template scope too ) // bootstrap API include("./index.php"); $mypage = new Page(); $mypage->template = "basic-page"; $mypage->parent = wire("pages")->get("/"); // root .... $mypage->save(); To load and edit a page which has fields with text formatters like dates or text fields, you might need to turn off output formatting of the page you edit. $page->setOutputFormatting(false); or alternative short syntax: $page->of(false); $mypage = wire("pages")->get("/about/"); $mypage->of(false); $mypage->template = "basic-page"; .... $mypage->save();
-
Hi there and welcome. Theres still room to fill but we're getting there. Lots of newcomers lately and we just started
-
Sorry for the delay, I've read your posts but forgot to further think about it and respond. It often happens I read it on mobile and forget about it later on laptop because it's already read. I think this is rather edge case and nice to have possibility, but for my needs it would make mostly more sense to have different field in PW and have a different css there if needed but never had. However you can simply overwrite the default tinyMCE config used by textareas in the default.php of admin theme. If you look at my Teflon theme there I'm setting the theme of tinyMCE globally via js. https://github.com/somatonic/teflon-admin-theme-pw2/blob/master/templates-admin/default.php#L90 There was a long thread where we figured this simple idea, but can't remember which thread This sample code works to use a "template-name.css" only on page edit process. So all TinyMCE fields will use this. <script> // overwrite TinyMCE skin setting globally // as defined in /wire/modules/Inputfields/InputfieldTinyMCE/InputfieldTinyMCE.js // and loaded before if('undefined' != typeof InputfieldTinyMCEConfigDefaults){ InputfieldTinyMCEConfigDefaults.skin = "default"; <?php if($page->process == "ProcessPageEdit") { $cssfile = $config->urls->templates . "css/" . $modules->get($page->process)->getPage()->template . ".css"; echo "InputfieldTinyMCEConfigDefaults.content_css = '$cssfile';"; } ?> } </script> I haven't tested further side effects and what if you want to still have different css for different fields... so this could also be made into a module that injects this code in the head of the admin page, so you could configure anything. Everything is possible in PW, just question how.
-
% looks lik it could be encoded url.
-
You mean page field not pagearray. The page array in my last example is instead of your array youre filling which isnt really nice and not needed. And the page array is handy to then sort it later. So I also dont understand petes thoughts as the page array has nothing to do with the structure.
-
command line script file API not performing same as on website
Soma replied to wes's topic in General Support
I'm not sure inside repeaters I think there's still some obscure things happening. Image field is always an array, it's just that page output formatting does change it so in template files you get an object if the image field is set to max 1 item. So if output formatting is off it's always treated as an array, disregarding the field settings. I think in case of a bootstrap there's no output formatting on I think. Since repeaters are pages attached to the page I think it may change something or not if you ad // short syntax of setOutputFormatting() $item->of(true); and this doesn't work? $item->my_mage->first()->url