-
Posts
490 -
Joined
-
Last visited
-
Days Won
4
Everything posted by owzim
-
I think there should be only one repo per language containing all module translations. One repo per language per module is overkill I think, because most of the modules need only one language file, right? Just for the sake of an comprehensive view in the repo, each Module should have its own folder. The repo then can be managed by someone who speaks that language and can take pull requests from other contributors. I think this central way is more approachable for those who want to help. What could be problematic is that the language files are created in only one line, compressed, which makes it hard to track line by line changes in a repo. I am willing to open such a repo for German if no one else wants to =)
- 19 replies
-
- 3
-
-
- multi-language
- i18n
-
(and 1 more)
Tagged with:
-
Horst, finally =) I've yet to dive into all of that but it looks great at first glance. Thanks for the awesome contribution.
-
Thanks Teppo, that's exactly what should be documented somewhere.
-
I use git in conjunction with git-ftp (https://github.com/git-ftp/git-ftp) It's awesome and very convenient.
- 30 replies
-
- 1
-
-
- deployment
- tools
-
(and 1 more)
Tagged with:
-
Hi guys, if you have your page tree structure, some of the pages with children act solely as a container. So some of the time, at least when I am structuring web sites the pages don't provide any content themselves. On a regular web site I do these two types of pages are very common: Type 1: Pages that list content, like news items, articles or images and then link to their respective full content view. Type 2: Pages that contain full featured pages which are very individual in content so you don't want to list them on a landing page. How do you treat those type 2 pages in your navigation? I've been using two different methods: They are not clickable, so there is no link associated with them The link leads to their first child I recently added these as options with radio buttons (with the Page Field, more on that) to my custom "options" tab I use on templates: (●) links to first child ( ) no link So in my menu creation loop is use something like this ($currentPage being the current page within the loop): <? if ($currentPage->numChildren > 0 && $currentPage->options->has("name=links_to_first_child")): ?> <li><a href="<?= $currentPage->children->first()->url ?>"><?= $currentPage->title ?></a></li> <? elseif ($currentPage->options->has("name=no_link")): ?> <li><a href="#"><?= $currentPage->title ?></a></li> <? else: ?> <li><?= $currentPage->title ?></li> <? endif ?> So, just wanted to share my method and ask how you go about it.
-
Thanks Ryan what an excellent module. What would also be great is that if you group fields within a field group that if that group is selected to be hidden from non superusers would also hide all field within that group.
-
Being able to compose a page of individual blocks on the fly has been requested a couple of times now. I remember asking for something similar some time ago (click). I think the obvious and most comfortable solution would be that repeaters have no fields attached to them but rather templates, or only one template to have the same functionality as we have now. One step further would be that one is able to attach more than one template to the repeater, and then while creating content when you click add item a drop down appears with the template names you added. You choose a template and the next repeater item contains the fields of that chosen template. Next item could be another template and so on. This would be awesome. I would create this kind of behaviour with a module/fieldtype but my knowledge of pw module development and the related api work is not sufficient yet. Sure this kind of structure can now be created with subpages but this is not convenient for clients, since they don't have all the content on one page. One argument I've seen a lot is that there is too less of constraints for content creators/editors so they would mess up things or go nuts with laying out content. But the developer can exactly define which templates are assigned to that repeater. And those individual blocks/templates are very much under control of the dev so I strongly disagree with that argument.
-
Great work! Thanks.
-
I know, I was writing that on the fly into the comment box. That happens a lot to me when I am switching between JS and PHP =) Thanks, I will definitely make use of the Textformatter version/
-
Thanks Ryan.
-
Ryan, I have the problem that the labelFieldName is rendered only unformatted. How can I force it to be rendered with formatting considered? Currently I am using a workaround with the Concatenate Fieldtype where I can force the formatting with an exclamation mark.
-
Hi Ryan, this is a great and useful module. I have some problems with it though: Let's say my concat string looks like this "title - somePagefield.title - someFancyHookedField" the someFancyHookedField is a field on which I manipulate the output with a hook (like described here) Everywhere else in my template files the output of that field works like it should but via the concat fieldtype it stays empty. Maybe the module does not take hooks on fields in consideration? edit: I did not read the description carefully, with an exclamation mark, the formatting of the field takes place and so does then the hook. PS: I get the same error like apeisa when renaming the field, no prio though.
-
If I have to be very focused I listen to soft electronic music like Liquid Drum'n'Bass (click) or the awesome Unreal Tournament Classic Soundtrack ( ). If I know exactly what to to and just cross off things my todo list I listen to rock/metal/chiptunes/techno/classic or pretty much anything else. I very rarely work without music, only when I forgot to turn it back on after being very excited about something and just work away.
-
What Useful Free/Cheap Tools/Software for freelancers/solopreneurs do you use?
owzim replied to einsteinsboi's topic in Pub
I use timeEdition for timetracking: http://www.timeedition.com/ I recently built me a tailormade "invoicing/quoting/proposaling" tool wit PW, so no tools there that I can recommend. Paper and pen are very useful and I should use them more often to write down/sketch out ideas quick. I tried a lot of todo list apps, but I always come back to just plain text files, in which I cross off those empty square brackets =) [ ] not yet [x] done =) I also use those text files to note anything project related. When I procrastinate too much I force myself to work with the pomodoro technique, very helpful. http://www.pomodorotechnique.com/ There a tons of pomodoro apps out there (http://gigaom.com/2010/11/10/9-free-pomodoro-timers/), or you could just use a kitchen timer, like the inventor did. -
Wanze, yes my bad. I mixed something up. Edited it out my post. Everything is working as expected in that case.
-
Thanks Soma, the echo and exit method might be sufficient for my case. Have to look into it further. Still, I am wondering why the $event->return is not working here. I would consider this a bug, since it's documented here: http://processwire.com/api/hooks/ (scroll to "How can my hook read (or modify) the return value of the hooked method?") that you can influence the returned value of hookable methods this way, with no stated exception.
-
OK, I am one step closer to what I want to achieve, still learning this hooking stuff. I put everything into a module, and add a hook into the init() function: $this->addHookAfter('FieldtypeText::formatValue', $this, 'myFormattedTextField'); public function myFormattedTextField($event) { $page = $event->arguments(0); $field = $event->arguments(1); $fieldValue = $event->arguments(2); if((string)$field->type === "FieldtypeText" && $field->name === "my_special_field") { $event->return = $page->title + " - modified Page Title ftw"; } } So here I have access to all field of the field's page, so I can fiddle around with that. One thing that passed on by me is that all fields of that field's parent page have formatting off: $page->some_field->of(true); threw an error. (edit: as Wanze stated it's $page->of(true), additionally I mixed something up) The ultimate goal for me would be an extra field type, where I can set a custom php output via admin (like the PHP you can set as a selector for pages on a PageField). If I am getting things wrong here, please let me know.
-
Thanks WillyC ... still not working ... This is my method: public function replaceEverything($event) { $event->replace = true; $event->return = "REPLACED, YO!"; } it still does not do anything when using (the page gets rendered as usual): public function init() { $this->addHookBefore('Page::render', $this, 'replaceEverything'); } But it works, so it replaces when using: public function init() { $this->addHookAfter('Page::render', $this, 'replaceEverything'); } =(
-
You mean like this? public function replaceEverything($event) { $event->replace = true; $event->return = "REPLACED, YO!"; } That did nothing =(
-
While this is working perfectly: public function init() { $this->addHookAfter('Page::render', $this, 'replaceEverything'); } This is not, nothing happens: public function init() { $this->addHookBefore('Page::render', $this, 'replaceEverything'); } replaceEverything looks simply like this: public function replaceEverything($event) { $event->return = "REPLACED, YO!"; } I want to replace the rendering entirely, so a hook after would not be efficient, since I don't need the previous rendering. What's wrong?
-
Hi, I was wondering if it is possible to hook some logic into the output of a certain field. System wide, front- and backend. I'm thinking TextFormatters. What I want for example is to: echo $page->some_fancy_field; And in the background it is making some very individual calculations and other fancy stuff with other fields of that same $page. The field itself holds no actual value. Possible?
-
Congrats on you first PW site. A great and interesting set of illustrations you have there. I have to admit though that I don't like the genericness of bootstrap that shimmers through the site, especially the tab buttons, but that might just be me. Perhaps style them appropriately to you awesome illustrator style and therefore make them more individual and less generic? Cheers.
-
I tend not to use functions but classes with static methods to organize code into contexts. In my config I place this code for example: function MZWHelpers($className) { $path = wire('config')->paths->root . 'site/templates/_classes/'; $file = $path . $className . ".php"; if(file_exists($file)) { include $file; } } spl_autoload_register('MZWHelpers', true); I can call them in my templates via: MZWHelpers::saySomething("hello"); The class gets automatically loaded and included in every template whenever I call methods of that class, so very convenient. If you add other classes to abstract/collect specific logic, you just add another autoload in the config for that class. Anyway, that's how I do it, perhaps there's a better way.
-
Hi, great work. Love the colors. Layout and graphical elements are very clean and solid. Though, I think the search input should look more like an input. Keep it up!
-
I was just encountering the same problem but with another root of evil =) I used it on a date field like: $pages->find("date_field!=''") for finding pages with non empty date_fields, but it turns out, the selector engine is using the unformatted value of the fields (what else, silly me), in this case the value of an unformatted date_field is 0 and not "" (empty) which is what it looks like on the admin page. So $pages->find("date_field!=0") works just fine.