-
Posts
1,487 -
Joined
-
Last visited
-
Days Won
16
Everything posted by Ivan Gretsky
-
My function is totally useless. This is the decision I was looking for. Have not done my homework. I never found $page->find() - probably confused it with $pages->find() every time visiting the cheatsheet. I think has_parent selector, which I was deliberately looking for so many times with no success, can also do the job. I need stronger glasses.
-
Yes, I took part in that conversation too. But it seems to me that the way it was supposed to work is to autogenerate name for a page on a pattern at creation time but not from the title. As there is no title on creation yet we could: either generate name from parent fields, dates, custon text + numbers, or apply the pattern on the first save (but not generate the title field by that pattern). If using your solution we have to: either not use title field for output as you probably would not want to use something like "prefix Wednezday...", or save the page to generate name field value and then change the title once again. I could misunderstand you as I did not apply you patch to the core.
- 100 replies
-
- template
- autogenerate
-
(and 2 more)
Tagged with:
-
Looks great. But It seemed to me that "Name format for children" option should define name of the page, not title. On the screenshot it is title that gets generated.
- 100 replies
-
- template
- autogenerate
-
(and 2 more)
Tagged with:
-
Joomla just recently changed their release strategy. I never heard we at PW have one )) I think we're mature enough to think about it. It seems a little strange to just freeze a version not providing any bug fixes in stable branch. Of course, it is strange only if you don't know how many people named Ryan from Atlanta are working on it . Anyway, clear release strategy is a must have to grow and to possibly involve more people in the development/bug fixing. Not sure what comes first though: strategy or more people .
-
I think Manaus is talking about "Name format for children" option under Family tab of the template when only 1 template for children is allowed. Availiable options are described here. But me too would want them to be more rich, maybe something like in this Adrian's module. Edit: Checked it out and did not find a way to combine date and title (with or without custom text in between). If anything but "PHP date format" is in the field we get what Manaus showed in his post: something like 15313431mondayeurope-moscow.
-
Was about to try XCloner as I know it back from Joomla times and found this vulnerability report, which seems to be not answered in any way by the XCloner team. Searched exploit-db.com for Akeeba and found just one which seems to be not so important one. Actually I would like to use some free script, but that the way it.is. By the way there are no entries about "processwire" there.
-
Good day! There was much talk about translatng PW recently. So this idea, if realised, probably could serve many... Translation is best done in context. So you can see on what page and doing what the user sees the string to be translated. One way I can think of in-context translation is allowing a translater to translate a string while browsing admin interface. A module I want to request should add markup to all translationable strings which will somehow highlight them when it is turned on. It should also be possible to (right?)click on that string and be linked to language translator page with corresponding file opened. What do you think about it?
-
Looking really nice. And the "powered by processwire" logo in the footer only makes it better)) Formbuilder forms could benefit from some styling, but they are not so easy to customize.
-
@Soma: My function returns all pages under a page, not only grandchildren. Is there a way to achieve this by selectors only? @Kay Lohn: You should call the function with both parameters, of course: $children = getAllDescendants($pages->get('/events/'), false)->find("template=photo_page_template, parent=/events/, include=all, is_featured=1, sort=-date, limit=3"); $prependRoot determins whether the root page will be included in the PageArray returned by the function. Should have put a default value for it anyway. My fault.
-
This code <?php foreach ($pages->find("template=photo_page_template, parent=/events/, include=all, is_featured=1, sort=-date, limit=3") as $child) { ?> will not work - it will only give you the direct children of /events/. The whole topic is about how to get all subchildren and/or only grandchildren, so read above )) If you incorporate my little function, you could do what you intend like this: <?php $listingPages = getAllDescendants($pages->get(/events/))->find("template=photo_page_template, parent=/events/, include=all, is_featured=1, sort=-date, limit=3"); foreach($listingPages as $listingItem) { ... }; ?> This way you only get featured photoes from under just the selected parent. You could just place the function in the template file before the actuall call to it. To have it to my disposal at any template I put it in _functions.php, which could be prepended to every template file by putting this line in the site/config.php file of your installation: $config->prependTemplateFile = './includes/_functions.php'; where "/includes/_functions.php" is the path to the file relative to templates directory.
-
2.5 - install.php error : Undefined index: dbEngine
Ivan Gretsky replied to Visi's topic in Getting Started
Could it be something with the system requirements not met? Check 'em out. -
The problem seems to be solved. As I did not localize it accurately enough in the first place, I cannot be 100% sure, but it seem to work alright now. Thank you, Adrian. Will report back if something goes wrong.
-
...and just to contribute to the original topic. I use this function to get all subpages of a page: function getAllDescendants ($root, $prependRoot) { $descentants = new PageArray(); foreach ($root->children() as $child) { $descentants->add($child); if ($child->numChildren()) { $descentants->add(getAllDescendants($child)); } } if ($prependRoot) $descentants->prepend($root); return $descentants; } I include this function in _functions.php file which prepends every template file and use it like this: <?php $listingPages = getAllDescendants($pages->get('some selector'))->find("some selector"); foreach($listingPages as $listingItem) { ... }; ?>
-
@Kay Lohn: Your "...limit=3" selector fires several times - as many, as there are children under "Projects". And each time it limits maximum number of featured photoes under that category. So you can output a maximum of (3 x NumberOfProjectsChildrenPages) featured photo pages. As Macrura suggested there are better/simplier ways to do what you intend to, like: <?php foreach ($pages->find("template=photo_page_template, include=hidden, sort=-date, limit=3")) { ?> <a href="<?php echo $child->link_to_page->url; ?>"> <img src="<?php echo $child->my_image->url; ?>" alt="<?php echo $child->image_desc; ?>"/> </a> <?php }; ?> Where photo_page_template is the template of you photo pages.
-
Good day, Adrian! I believe I found a bug in the module. Once again it is probably encoding related (you're becoming true authority on that, like it or not ). If "Rename on Save" option is checked and you have some images in RTE field, non-latin characters get screwed up on save. Like this: Most likely none-RTE fields and RTE fields without images are not affected.
-
There is a list of 3rd party modules on Mobile-Detect github repo page. It can be beneficial both for PW in common and the module to include the latter in that list. @justb3a: If you feel like the module is mature enough please consider submitting it there.
-
Add a new action button to page edit screen
Ivan Gretsky replied to Ivan Gretsky's topic in Themes and Profiles
Yes, but I do not know how to insert a tab with classified items and a button in the first place )) Could you help on this too? -
Add a new action button to page edit screen
Ivan Gretsky replied to Ivan Gretsky's topic in Themes and Profiles
Yes, I understand what you are suggesting. Thank you! But this solution seems to me a bit "clumsy". I think it would be more convinient for the client to have a tab like "Children" with a list or related classified items and a big green button "Add new classified item". When user pushes that button he should be send to a new page creation screen with "classified-item" template chosen under specified root page AND company page field set to the company page he came from. Do you have an idea how this could be done? -
Good day! Sorry for not finding it if it is already out there in the forums. I did try, but probably do not even know the right words to put into a searchbar. I need to put a button in the page edit screen of the admin for a specific template. When a user clicks on that, he should be led to creation of a new page, related to the one he is on. Making it more of a real-life situation: it is a company page with a template "company" under "company-root". I need to place a "Create new classified Item" button on the edit screen for every saved page with that template When a user clicks on that he should be led to creation screen for a new page with "classified-item" template to be stored under "classified-root" template. I guess this should be a module which hooks into some method... But I am in the beginning of my journey to PW module-making, so please give me some (preferably clear and simple) directions.
-
I just downloaded and tested Pretty Photo on Windows with Firefox. The example does work smoothly (exept for some problems with flash). On your site it does not.
- 17 replies
-
- 2
-
-
- PrettPhoto
- Lightbox
-
(and 1 more)
Tagged with:
-
I'll dive into it ))
-
My bad. I thought it is out of scope error (which probably happened when majkris was performing $fields->save if I got it right). I am glad Adrian helped us here. But I want to take something out of this for myself too . As I understand, $page = $event->arguments[0]; sets $page variable in the scope of the class method. But I do not know what is $event and its arguments. Where do they come from? I would be happy to get an explanation or a link to documentation article/forum post.
-
Welcome to the friendly forums of ProcessWire dear Majkiris! Check this out. It will probably help with you in your quest.
-
This is what I think we should ask to be done - generate the "translation" files for the default (English) language. We surely should base all further work on that and should be able to update the base translation easilly by parsing the core with in-build tool and meging the results to github. I plead the gurus of PW forum to help us with that.
- 13 replies
-
- Translation
- Documentation
-
(and 4 more)
Tagged with:
-
Just a wild guess - try putting your main.js file under jquery link or remove it at all.
- 17 replies
-
- PrettPhoto
- Lightbox
-
(and 1 more)
Tagged with: