Jump to content

totoff

Members
  • Posts

    495
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by totoff

  1. hi, good news. i've found the mistake i made and have a working code now: <?php // First iterate through all categories defined by pages with template kom_catlanding $categorycount = array(); foreach ($pages->find("template=kom_catlanding") as $category) { // fill the array $categorycount where the key is defined by title and the value by pages with template kom_project and field project_services containing a page from $category $categorycount[$category->name] = $pages->count("template=kom_project, project_services=$category"); } ?> <ul id="catcloud"> <?php foreach ($categorycount as $category => $number) { echo "<li><a href='/leistungen/kategorien/$category' class='$number'>{$pages->get("/leistungen/kategorien/$category")->title}</a></li>"; } ?> </ul> <!-- /catcloud --> that fills the bill only thing i'm wondering is, if the code could be optimised somehow. is there a better way for the page url than "/leistungen/kategorien/$category" if so, i would greatly appreciate your hints.
  2. hello, thanks again and sorry that it took a while for me to get back to this project. the good news is that i figured it out to make this work on my project - or almost work. this is my php code: <?php // First iterate through all categories defined by pages with template kom_catlanding $categorycount = array(); foreach ($pages->find("template=kom_catlanding") as $category) { // fill the array $categorycount where the key is defined by title and the value by pages with template kom_project and field project_services containing a page from $category $categorycount[$category->title] = $pages->count("template=kom_project, project_services=$category"); } ?> this returns an array with the desired key/value pairs. the bad new is, that i'm still uncertain if i fully understand what the script is doing. therefore i commented what i understood it is doing and would greatly appreciate if you could do me the favor to confirm wether i'm right or wrong. but, even worse, i've not yet managed to link back to my category "landing pages" from my tag cloud. here is my code <ul id="catcloud"> <?php foreach ($categorycount as $category => $number) { echo "<li><a href='/leistungen/kategorien/{$pages->get("title=$category")}' class='$number'>$category</a></li>"; } ?> </ul> <!-- /catcloud --> this code doesn't work because it returns the ID of the page instead of the title. obviously it could never work because what would be required is the name instead of the title. but if i change from title=$category to name="$category" i get error messages: i've gone through the documentation and the cheat sheet but am quite lost. so i need to ask for your help again. could you give me a clue? thanks
  3. hi and good morning, thanks for your replies both. i'll try to implement this later today when i have time to work on the project again and report back. best regards
  4. hello forum, after a bit a humble start i think i've wrapped my head around pw a little better... that's why i'm now in the general support forum and not any longer in getting started ;-) however, i'm working on a portfolio site for an engineering company and i've set up categories to organize the way their work is presented on the site. setting up the categories was easy and works good thanks to the tutorials in the forum here. but now i would like to present the categories as a tag cloud and therefore need to get the number, how often each category has been chosen for a portfolio item (aka page). this is a bit over my head in php. could someone point me in the right direction? thanks pretty much in advance!
  5. hello forum, i've read somewhere in the docs that the use of template tags was given up with the switch from version 1 to 2. does that mean this code <li><a$class href='{$child->url}'>{$child->title}</a></li> as found in the head.inc with the official download is no longer valid? Or is the use of curly brackets a regular use of PHP (I'm very new to PHP unfortunately)? Wouldn't you rather write <?php echo $child->url ?> instead of {$child->url} ?? thanks, christoph
  6. thank you very much pete. i'm excited to start off with my first pw project. hope that i don't have to come back here too often ;-)
  7. hello forum, i've just installed pw in a shared hosting environment and was prompted the same errors. i've set chowner for /site recursively to www-data in order to proceed with the installer. after that i've changed chowner for /site/config.php back to my ftp-user and set chmod to 0644. however, i'm still concerned about www-data being the owner of the whole /site directory. my question: would it be sufficient to give pw write permission only for /site/assets/? or does pw needs write permission for /site and all it's subdirectories? unfortunately in my hosting environment changing chowner is the only way to give a php-script, that has been created by an installer, write permission. thanks for your time.
  8. many thanks for this quick reply pete! it is, but i was concerned about what to do when on a live server. your reply has clarified that. . yes, it is. i'll go with 755 than on a live server, thanks.
  9. hello forum, i'm an absolute newbie to pw who has worked (and still works) with textpattern and contao. i have a firm grasp of html, css and some of jquery but very little of php (not to say nothing at all 8) ). i came across processwire and it looks very, very promising to me. i installed locally on xammp. however, immediately i'm having my first questions. pleas apologize, if this are silly questions from a pro's point of view: - on finishing the installation i got the following message: but how do i do that? does that refer to the permissions my ftp user has? and what would be the right permission (0000)? - within /site/config.php i found the following comment: does that mean, all directories processwire will creates will have assigned 0777 permissions? this doesn't matter to me on localhost, but live, in a shared hosting environment, this seems to be a high risk. if so, is that really necessary or can it be overcome somehow? thanks for answering and for your time! totoff
×
×
  • Create New...