Wanze
PW-Moderators-
Posts
1,116 -
Joined
-
Last visited
-
Days Won
10
Everything posted by Wanze
-
Just noticed that with the latest dev, floats are stored as integers in the db. For example: 0.3423 -> 0, 3.5 -> 3 I'm using text-fields and cast them in PHP to (float) or (double) when needed.
-
PageField: Switching from Checkboxes to Page Autocomplete does not work
Wanze replied to doolak's topic in Modules/Plugins
doolak, you can adjust these settings in the config of the Module "InputfieldPagename". There I have changed mine -
PageField: Switching from Checkboxes to Page Autocomplete does not work
Wanze replied to doolak's topic in Modules/Plugins
Yes that's ok, I have the same. Edit: @Soma In my case I have those settings: ö=oe, ü=ue etc. So this should not be the problem, but maybe worth to check. -
Problems displaying resized images within an images repeater
Wanze replied to netzartist's topic in Getting Started
You're welcome, glad to hear it works! This is ProcessWire, you can solve almost every problem in less time with less coding... Sometimes I ask myself: Wow this is so simple with Pw, how would I've done this before? ;-) -
PageField: Switching from Checkboxes to Page Autocomplete does not work
Wanze replied to doolak's topic in Modules/Plugins
I quickly checked the issue with the umlauts, it works also fine here. Could this be something DB related, maybe the collation of your table isn't set as utf-8? -
I was always working with windows, started with 98 - ME- 2000 - XP - Vista - Win7, I know them all I'm a Mac user since November 2010 when I started working as web-developper and needed a Mac. I remember my first problem: Damn, why can't I right-click in a folder and create a new file this way? Create every file from the editor? I hated finder (still think its not a great Explorer). On windows I was working with PsPad Editor, a free editor with Syntax highlighting for all + built in FTP. On Mac, there wasn't a free tool that could do the same Nowadays, I feel very comfortable on Mac, but I agree with apeisa: Win7 is a great Os.
-
Problems displaying resized images within an images repeater
Wanze replied to netzartist's topic in Getting Started
Hi netzartist – welcome to the world of Pw! Don't use repeater fields for multiple images. You achieve the same with the "Image" Fieldtype by setting maximum files = 0. This way you can upload and store multiple images with descriptions. You can do these steps: - Remove the repeater from your template - Change the "maxiumum files allowed" of your images field to 0 - Add the image field to your template - Upload multiple images Then your code needs minor changes: foreach($page->children as $news_item) { ... //images is the name of the Image Field if (count($news_item->images)>0) { foreach ($news_item->images as $image) { <?= $image->width(250)->url; ?> <img src="<?= $image->width(250)->url; ?>" width="250" alt="" title="<?= $image->description ?>" /> } } } Here's why your code didn't work: foreach ($news_item->image_repeater as $image) { //$image is not yet your image field, it is an "Item" of your repeater which can contain multiple fields } //This would work, but if you only need multiple images, don't use a repeater foreach ($news_item->image_repeater as $item) { $image = $item->image; //... } -
True words. Every time I do this, I have to wait 2 hours till the 175 updates are installed
-
Yep that belongs to the template file itself. But when you change for example fields like title, body, images etc in ProcessWire, Smarty doesn't know. You won't see the changes on your website until the cache time is up.
-
[resolved] root URL and categories as page field
Wanze replied to Sanyaissues's topic in General Support
Here's a solution that should work: Enable urlSegments on the homepage template, then in the home-template you need some logic to handle the segments: $home = true; if ($input->urlSegment1) { $category = $sanitizer->selectorValue($input->urlSegment1); $c = $pages->get("name={$category}"); if ($c->id) { echo $c->render(); $home = false; } } if ($home) { //Do your homepage stuff... } You need to create the links to the categories yourself.- 10 replies
-
- 1
-
- categories
- url
-
(and 2 more)
Tagged with:
-
Quick Idea: The smarty cache could be cleared when a page is saved, hooking after Page::save. What do you think? Cheers
-
Cool, thanks for making this! I know smarty from my past, I liked the "template inheriting" stuff. One question: As you can't use php tags in templates know, what do you do if you need php logic? Where do you handle this? Cheers
-
Installation error: Unknown MySQL server host 'Config'
Wanze replied to sbarner's topic in Getting Started
Hi steve and welcome! Sounds like for some reason the Database Host is not recognized. Can you check those database settings in /site/config.php (at the bottom of the file): Is everything correct there? $config->dbHost = ''; $config->dbName = ''; $config->dbUser = ''; $config->dbPass = ''; $config->dbPort = ''; -
Stefan Wanzenried Bern, Schweiz @schtifu (someone has "stolen" my nickname, I joined too late...) everchanging.ch
-
Hi retro and welcome. I think ProcessWire Pages are perfect to manage your models + you can use the Pw API for your queries. With the Page fieldtype, you can model all relations you need (1:n, n:m). Pw is really fast and as long you don't query "huge" data i think performance is not a problem. There's also the MarkupCache module to cache generated markup for a given amount of time in addition to the Template-Cache. (and of course the new ProCache module) Another advantage: You already have the admin interface to create/edit/delete data. Also you are more flexible if you need to extend fields. Is the site already online? However, if you decide to use custom tables, you can use a 3th party ORM or Pw's mysqli: //in Template $db->query("..."); //in Module $this->db->query("SELECT * FROM players")->fetch_array(); For the admin, you could create "Process" modules. These are sites that run in Pw's backend. I'd go with the first solution. Just ask if you have questions how to structure your Pages
-
Do you have the Textformatter "Html Entity Encoder" applied to the TinyMce field? Remove it and it should work. Does it?
-
Haha! It's gonna be legen... ...wait for it... ...and I hope you're not lactose intolerant because the second half of that word is DARY!
-
Accessing a particular instance of a repeater field
Wanze replied to thetuningspoon's topic in General Support
I'm not sure if this is still possible, but you should not use nested repeaters (repeater in repeater). Can you give an example code of what you want to achieve, I think I didn't get it -
My suggestion: Start with the blog profile and build the rest of your site around. I just finished a site this way - the blog lives under a "blog" menu. The advantages: You have all the features of a blog "out of the box", in my case I didn't even need them all. Take a look at the blog profile: There's a file called "blog.inc.php" with functions for searching and listing posts, comments etc. which you can reuse also on other parts of the site. All the markup of the blog is separated in a folder "markup", should you want to change this. Cheers
-
Hi Mani The dev version of ProcessWire has a website field. You can "enable" it in the comment-field options. Edit: Too slow again
-
Thank you ryan!
-
There is a module for Twig: http://modules.processwire.com/modules/template-twig/
- 74 replies
-
- template engine
- twig
-
(and 8 more)
Tagged with:
-
Another ProcessWire site is online: http://www.christophkunz.ch I'm using the awesome blog profile as base. Today I showed christoph the Pw-Admin – so simple and easy to use, I think he'll love it. (The previous site was running on modx). Credits to ProcessWire here: http://www.christophkunz.ch/impressum/ Any feedback is appreciated, it's not 100% finished yet Cheers
-
Custom Page field in user template won't fully change
Wanze replied to adrian's topic in API & Templates
Glad you solved it! Just a little remark: No need for the first line, in your templates you already have a variable $user for the current user: $organization = $user->organization->first()->name; Cheers -
Do you mean a <select> / dropdown menu? You can create this with the "Page" Fieldtype. Under the Input tab, you can choose the "Input field type" as "select". The options to choose are pages, so you want to create those somwhere in your page tree.