-
Posts
330 -
Joined
Everything posted by ottogal
-
With the second option (using a checkbox) the handling would be easier in the case of non-member authors who later on may advance to member status. What about the output of the comma separated list of authors: The loop could be something like foreach ($authors as $a){ $out .= $a->lastname . " " . $a->firstname . ", "; } Then to remove the last two characters (", ") you just use a PHP string function: $out = substr($out, 0, -2);
-
Could you reveal more details about your templates? (Their fields, etc.) And what is the structure of the CSV file? (First line of column titles, and a sample of the following lines) Edit: Wasn't that intended to be $author = $pages->find("
-
Page Field vs. PageTable Field differences
ottogal replied to Jonathan Lahijani's topic in General Support
Thank you @bernhard, that was really fast... I'll dive into it and try to understand. -
Page Field vs. PageTable Field differences
ottogal replied to Jonathan Lahijani's topic in General Support
My question is the other way round: Could a PageTable have the option to limit itself to one row - like the choice of Simple Page for a Page field? (Or to limit it to a configurable number of rows.) Background: I would like to profit from the "presentation capabilities" of a Page Table field, but want to restrict it to a maximum of one Page (row). Chosen this option, there should be an Add new button only as long as the Page Table is empty. After adding 1 row, the button should disappear. (I would like to avoid the hook proposed by @Soma here - btw: I couldn't get it to work.) -
Hi Mel, I'm not sure I understand your intention in full. Assuming that "members" and "authors" are different entities, I would create templates for members, authors and publications. The publication template gets a multiselect pagefield to the authors, so you easily cover the case of more than one author of a publication. And yes, the members template contains a pagefield to the publications (multiselect too). What about the markup: That's a question of the template files, not of the templates.
-
Thanks! Looking forward...
-
Make the file /site/config.php temporarily writeable and add this line: $config->httpHost = 'domainname.com'; You can also add a "Whitelist" with the variants you want to allow in this way: $config->httpHosts = array('yourdomain.com', 'www.yourdomain.com');
-
Try this: <title><?php echo $page->get("seo_title|title") . " | " . $config->httpHost; ?> See https://processwire.com/api/variables/config/
-
It seems strange to me that in your screenshots of the Family settings of Template Categories none of the radio options is ticked. Something wrong with that? (Of course, the Categories page must have children allowed.)
-
Danke, LostKobrakai.
-
Thanks mr-fan, I'll try.
-
@MadeMyDay What about the compatibility of PageTableExtended with PW 3.0.x devns?
-
Installing the german lang pack for PW devns https://github.com/Manfred62/pw-lang-de-devns into PW 3.0.24, files like .gitattributes .gitignore README.md are not uploaded because of invalid file extension - allowed are .zip .json .csv only. Does this do any harm? (It seems to work anyway.)
-
@LostKobrakai It should be like this, shouldn't it? $page->parentsUntil("hero_gallery.count>0") If not, could you explain it a bit further?
-
Welcome to the community! Have a read of this thread. So you should try something like this: if (count($page->hero_gallery)>0) { $hero_images = $page->hero_gallery; } else { $hero_images = $page->parentsUntil("count(hero_gallery)>0")->hero_gallery; } (Just written in the browser, didn't try it myself.)
-
Learned something new here, too. Thanks to all.
-
Did you use the Page Add Bookmark Editor to create the wanted bookmark under Add New ?
-
Just guessing: Shouldn't you change RewriteBase / to RewriteBase /html/ ?
-
Bump...
-
After clearing the cache tables from the database, you should refresh the modules (Admin > Modules, green Button "Refresh" on top).
- 1 reply
-
- 1
-
-
Of course it wouldn't work like I proposed since the function treeMenu() is called recursively... So better try kongondo's example. Or try to put the wrapping ul tag out of the function: <?php function treeMenu(Page $page = null, Page $rootPage = null) { if(is_null($page)) $page = wire('page'); if(is_null($rootPage)) $rootPage = wire('pages')->get('/'); $tree = ""; $parents = $page->parents; foreach($rootPage->children as $child) { $class = "level-" . count($child->parents); $s = ''; if($child->numChildren && $parents->has($child)) { $class .= " on_parent"; $s = str_replace("\n", "\n\t\t", treeMenu($page, $child)); } else if($child === $page) { $class .= " on_page"; if($page->numChildren) $s = str_replace("\n", "\n\t\t", treeMenu($page, $page)); } $class = " class='$class'"; $tree .= "\n\t<li>\n\t\t<a$class href='{$child->url}'>{$child->title}</a>$s\n\t</li>"; } return $tree; } $out = "\n<ul>\n\<li>\n\t\t<a href='{$rootPage->url}'>{$rootPage->title}</a>\n\t</li>"; $out .= treeMenu(); $out .= "\n</ul>"; echo $out; Note that I changed the local variable $out in the function to $tree. (I didn't test that myself...)
-
Try to replace the line $out = "\n<ul>"; with this one: $out = "\n<ul>\n\<li>\n\t\t<a href='{$rootPage->url}'>{$rootPage->title}</a>\n\t</li>"; (adding a class to the a element and modifying the \t tabs as needed).
-
ProcessSlider - Image sliders for ProcessWire
ottogal replied to mauricius's topic in Modules/Plugins
... the Forum? Anyway: Welcome! -
You could just set a bookmark to the Recently Updated Topics page (or to the Unread Content page). Or even make it the start page of your browser...