Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/12/2013 in all areas

  1. Starting in on a new site tonight and realized I never posted the last site we finished in March. www.la2050.org This was a information frontend site for a campaign to get people submitting proposals for a community funding project. Client was able to edit a ton of the site and never had any issues dealing with the backend. I learned a ton about markup/template organization from the threads here which were unbelievably helpful. Thanks everyone! Thanks Ryan!!!
    8 points
  2. I don't think categories is the way to go here. 1. Nested Structure This is a good example where the date structure could be used to create the articles. Then you would a) have the urls already and b) an easy way to create lists and such. Additionally add a date field to the article template so you can choose the date and use that for additional searching. /dagboek/ /2008/ /januari/ // or use "01" as name whatever you like /article14012008/ /article15012008/ /februari/ /article01022008/ /2009/ /januari/ Then loop the years and months in a simple nested php script using API. You don't need to check if there's a year or month with articles if you create months manually. $years = $pages->get("dageboek")->children(); $out = ''; foreach($years as $year) { $out .= "<ul>"; $out .= "<li><a href='$year->url'>$year->title</a>"; if($year->numChildren) { $out .= "<ul>"; foreach($year->children() as $month) { $out .= "<li><a href='$month->url'>$month->title</a></li>"; } $out .= "</ul>"; } $out .= "</li>"; $out .= "</ul>"; } echo $out; Then on the years or months template file, you simply render out their children in any fashion you like and may add pagination using the built in Pager module. You'll have urls like /dagboek/2008/01/page1, dagboek/2008/01/page2 2. Flat The other route would be to use a flat structure and add articles to the /dagboek/ parent. Then add a date field to the article template you can define the day this article is for. Then use a script that checks for articles (oldest, newest) and generate a menu with virtual urls for each year and month that has articles. The URL then can be resolved using urlSegments to show a list of articles for the selected month. You'd have to enable url segments on the dagboek template to make this work. This is a script I created for generating a year month nested menu only for the ones that articles are found. $datefield = "mydate"; $template = "article"; $url = $pages->get("/dagboek/")->url; $newest = (int) date("Y",$pages->find("template=$template, $datefield>0, sort=-$datefield, limit=1")->first->getUnformatted($datefield)); $oldest = (int) date("Y",$pages->find("template=$template, $datefield>0, sort=$datefield, limit=1")->first->getUnformatted($datefield)); $out = ''; for($y = $oldest; $y <= $newest; $y++){ $out .= "<li>"; $out .= "<a href='#'>$y</a>"; $month_out = ''; for($m = 1; $m <= 12; $m++){ $month_start = strtotime("$y-$m-1"); $month_end = strtotime("$y-$m-1 +1 month"); $selector = "template=$template, $datefield>=$month_start, $datefield<$month_end"; if($pages->count($selector)) { // use count instead of find for fast query $month_out .= "<li><a href='{$url}$y/$m/1'>$m</a></li>"; } } if(strlen($month_out)) $out .= "<ul>$month_out</ul>"; $out .= "</li>"; } echo "<ul class='menu'>$out</ul>"; Then, on the dagboek template something like: if($input->urlSegment1 && $input->urlSegment2) { $year = (int) $input->urlSegment1; // 2008 $month = (int) $input->urlSegment2; // 02 $start = strtotime("$year-$month-01"); $end = strtotime("$year-$month-01 +1 month"); // find the articles for within that current month $articles = $pages->get("/dagboek/")->find("template=article, date>=$start, date<$end, sort=-date"); foreach($articles as $article) { echo "<h2>$article->title</h2>"; echo $article->body; } } Just rough examples.
    5 points
  3. There's no thing as to change a file field to a image field on runtime just for if there's an image. There's no standard way as it's not meant to be used that way. The only easy way would be to create a new Pageimage with the file. This requires an image field attached to the page in question so it can use that. foreach($page->files as $f) { if($f->ext == 'jpg'){ $image = new Pageimage($page->images, $f->filename); echo "<img src='{$image->size(100,0)->url}'/>"; } }
    5 points
  4. @ranzwertig I'm pretty sure the problem is with your strtolower() function. You should use mb_strtolower() instead. Make sure you have --enable-mbstring option activated. Here are the instructions.
    3 points
  5. not my first choice. Imho too much px values inside. Also the width's are preset? (w320, w640...) When searching for grids I prefer only em and/or % values. This is imho more flexible.
    2 points
  6. This module is now updated to use the new Twitter API: https://github.com/ryancramerdesign/MarkupTwitterFeed Be sure to read the install/upgrade instructions. Also note that the module now requires PHP 5.3.
    2 points
  7. hhmm, sounds intriguing. Susy > SASS/SCSS > Ruby, right? I just checked, and I DO have Ruby 2.0.0.p0 installed locally I guess I'll be learning something NEW this weekend!
    2 points
  8. what.i use this is good it does.work top {not buttock}, of htaccess u will.put it . enjoy <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/octet-stream "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" </IfModule> <IfModule mod_headers.c> <FilesMatch "\\.(ico|jpe?g|png|gif|swf|woff)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch> <FilesMatch "\\.(css)$"> Header set Cache-Control "max-age=2692000, public" </FilesMatch> <FilesMatch "\\.(js)$"> Header set Cache-Control "max-age=2692000, private" </FilesMatch> <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary: Accept-Encoding </FilesMatch> Header unset ETag Header append Cache-Control "public" </IfModule> <IfModule mod_deflate.c> AddOutputFilter DEFLATE js css AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </IfModule>
    2 points
  9. Open thread for discussion about Vietnamese Translation/Language pack. Currently, the language pack is hosted on: https://github.com/xgenvn/processwire-vi_vn-translation
    2 points
  10. Hi all, I just found this site offering web design amongst other thingz. Comments please!!! You will see why I do not want to create a link to the site. www [dot] sandau [dot] biz
    1 point
  11. Danke, ich hatte das gleiche Problem auf zwei Seiten, aber jetz beiden arbeiten.
    1 point
  12. To me, grid has to be cofigurable - otherwise it's probably too limited for everyday use. When I can adjust number of columns, gutters and paddings, I know I can use my grid basicly on every project, no matter who designs it.
    1 point
  13. I only use the sass preprocessor while developing on my local machine. I deploy the generated css to the live site. I might be wrong, but this is best practice I believe. I haven't got time but you can search Google for sass workflows.
    1 point
  14. If you give .span3 in "/site/templates/css/bootstrap-responsive.css" Line 146 a height: 320px; (for example) it is solved. So I'm not a css expert (lol) but it has something to do with the different heights of the thumbs. And as of .span3 is invisible, from aspect of design it may be better to set the thumbs visibly to the same height?
    1 point
  15. $thumburl = $image->width > $image->height ? $image->size(450,0)->url : $image->size(0,320); echo "<img src='$thumburl'/>";
    1 point
  16. Yeah, I was a little bit worried with all the Ruby stuff, but it's just to preprocess the css. You don't need it on your own webserver.
    1 point
  17. ohthanks, Very nice! The only thing I was wanting was a more obvious way to move between "indicators". The sidebar nav works, but I missed it at first being under the rating system. (nitpicking). I love Avenir, nice type choice.
    1 point
  18. Huh? Do you mean the "parent_class" ? https://github.com/somatonic/MarkupSimpleNavigation/blob/master/MarkupSimpleNavigation.module#L26
    1 point
  19. hey kongondo, absolutely! (...although it's only a tiny gallery made with repeater fields)
    1 point
  20. Kunane, If you have the time, when you are done, please do a short write-up how you approached/accomplished this. It will help others . Thanks!
    1 point
  21. http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/
    1 point
  22. Greetings, Great -- just when I was finally settled on "just using" Foundation, now Kube goes and starts a whole new round of framework experimentation. Thanks, Matthew
    1 point
  23. You could also use php's trim function to remove whitespaces of a string: echo trim($categories);
    1 point
  24. Basically I am wanting to access all the tags (either as a string or array) for a field. Not sure if this is possible, but it would be something simple like: $field->tags Based on what I see here: http://processwire.com/api/variables/fields/ I don't think it is possible, but maybe someone knows of another way I might easily be able to access these. Thanks
    1 point
  25. by.per hour web developmant 14,692.50 jmd or $150 usd or 3.5 oz kb
    1 point
  26. I think that purely because it varies so wildly from individuals up to agencies, plus how complex the job is (a forum setup in one software is easier than another, similar with styling) you might have a hard time getting responses to this manviny. In my experience, no two jobs are ever the same, even if someone wants the same as a previous client
    1 point
  27. Expanding previous reply a bit, once you've selected a page in this page field, "maths" as an example, you can of course do something like this in front-end of your site: <?php // if your page field is limited to one page and returns a Page object: echo $page->your_page_field->category; // if there are / can be multiple selected pages in this field and a PageArray object is returned: foreach ($page->your_page_field as $item) { echo $item->category . "<br />"; }
    1 point
  28. A page field always saves the page id of the selected page, there's no way to save another value. After all it's just a relation with from page id to page id.
    1 point
  29. I think this sounds like a fine approach, though would be more inclined to generate it dynamically. Assuming the JSON is originally generated from ProcessWire, having it generated dynamically is going to give you more flexibility and make it easier to update. Having a dynamic request cached is basically the same thing as having a static file. You could cache it with MarkupCache, the built-in template cache, or ProCache. On the other hand, if the data really is static, then you don't need ProcessWire to generate it or serve it, as you could just upload a JSON file to a page and be done with it.
    1 point
  30. You should be able to access it with /site/assets/myfile.txt
    1 point
  31. I think simply using a fully qualified URL would do it - like //www.example.com/assets/myfile.txt
    1 point
  32. I think that Processwire can fit nearly everything . But how many shops must manage the web-app ? I think that the problem is to manage the usage and the syncronization with the server when the shop is temporary offline... USSliberty
    1 point
  33. Hello Ryan, In the introduction you write that there is an issue when using ProCache with the LanguageLocalizedURL module. Is this still an issue and if so when do you expect it will be save to use? Thanks BTW, and thank you and all contributors for making ProcessWire for what it is (and will be in the future). With Processwire I feel like starting to build what I want instead of first stripping what I don't want. I've tried several CMSs and examined how far I could get (with my limited coding capabilities) to make exactly what I want. Processwire is the first that hasn't stopped me and doesn't force me to make all kinds compromises.
    1 point
  34. If you use jquery theres some easy way and do it client side. If you add ?q=searchword to the search result links it's easy possible. Some helpful links To get a url parameter http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery An lightweight plugin to highlight the word on page http://bartaz.github.com/sandbox.js/jquery.highlight.html
    1 point
×
×
  • Create New...