Jump to content

SiNNuT

PW-Moderators
  • Posts

    1,011
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by SiNNuT

  1. No! Fields can have different settings on a per template basis. This is called a context. A nice screenshot here: https://processwire.com/talk/topic/7274-are-there-better-fields-naming-convention/?p=70296
  2. SiNNuT

    The grid

    Content is king, they say. But at the very least presentation is its prince. I sometimes feel it's even the other way around. When browsing for a product, service or other items of interest, i tend to rate -in part- by the way they present themselves on the web. When it's close i usually go for the one with the most 'up to date'/modern look and feel. You could say this is shallow, but i think a lot of people operate this way, consciously or unconsciously.
  3. For emphasizing text you would normally use italics, bold or both combined. These are part of the default buttons a CKEditor field. This will result in some html: <strong>strong</strong> <em>em</em> <strong><em>strong and em</em></strong> But maybe you mean something else. On a sidenote: the CSS could be setup to not even show (on the front-end) the differences.
  4. diogo has already partially beaten me to it it, but: You can probably convert non-CKEditor textarea fields, like summary, to CKEditor, BUT: Using CKEditor will make html contents, unlike plain text in a regular textarea. This potentially can severely mess up your layout, if you don't know what you are doing. So plz. be carefull.
  5. Basically, yeah. As an example, (part of) a fictional site tree: items -item(newsitem) -item(pressrelease) -item(statusupdate) -item(newsitem) -item(newsitem) -item(pressrelease) tools -item_categories --newsitem --statusupdate --pressrelease My item template would have a page field referencing 'item_categories' as the parent for my item categories. This way, when you make a new item you choose the category which it belongs to. Very flexible, and using selectors you can then use your items to display however and wherever you want in your site. Make an RSS feed of your press releases? easy. And, because it's all pages, infinitely scalable. For easy back-end management you could set up a couple listers, if you want to. EDIT: the tools section would usually be a hidden section, a building block section if you will.
  6. I always tend to collect these types of items as pages under one parent page. Ideally even using one template, when needed multiple. This can be news items, press releases, blog posts, status updates, you name it. It's basically just a container for a stream of 'timestamped' items in varying categories. More often than not they can share the same fields: a body text, some images and/or files etc, whatever you wish. I categorize them by using a page field. In the long run this kind of setup, to me, is the most flexible and scalable.
  7. Fields with the 'bar' are fields of the type Textarea, that have enabled the so called rich text editor CKEditor (or TinyMCE for older PW versions). By default, the summary field has not. This can be easily changed, if you have the correct admin permissions. If possible i would contact the person who build the site first.
  8. Think of these as 'system' values. You only create a page once, this value never changes. Same with modified. On top of that you can add as many date time (or time) fields you want, like, 'created_date', 'publish_date', 'unpublish_date' etc.
  9. Awesome stuff!
  10. I've had similar behavior when using a Hanna Code inside a field called 'body', which was a textarea with CKEditor. The page that had the Hanna Code on it, was listing a choice of it's children and subchildren, which also had the same body field. In my case i could not get the children body displayed via the Hanna. I solved it by changing the body field on the children to a new similarly typed field, with a different name. At the time i didn't really give it a second thought because at that stage it was an easy change, but it's something to be aware of. I really don't know if this might be in the realm of bugs or if this makes total sense because of the way Hanna Code works, and if the Hanna you use does certain things.
  11. If you try to get clever and stuff your site with a lot of keywords this can even lead to search enigines penalizing your site score. In general i think it's best to focus on good titles, descriptions and content and don't use keywords.
  12. SiNNuT

    Joomla! is the best!

    If we are in cmscriticcritic mode i must say i totally agree with diogo's post.
  13. Putting probablity and divisor in config.php worked for me on a ubuntu server.
  14. Weird. This stuff should really be easy. Unless there is something really strange in your setup it must be some bugs in the way the links and/or anchors are generated. Let us know if you succeed in setting something up on lightning.
  15. Yes you could try setting the probability to '100' for testing purposes. Garbage collection *should* then run on every session start. If that still does not work i'm not sure what's happening, because your settings seem to be fine. Maybe GC is somehow unable to delete in site/assets/sessions
  16. I would give it a little bit more time. It's not always true that no older files than 'current time - 86400 seconds' should exist. probability/divisor = 1/100 = 1% : The garbage collector will run once per 100 new sessions, and then clear all files older than 86400. Although, if you already have 7000 session files, it should be pretty close to exactly 86400 seconds.
  17. Something like this. In essence your Read more links will need to have the hashtag that point to an id (this is the location) on the full article page. <div id="articlesContainer"> <h2>Articles & More</h2> <?php $articlesItems = $pages->find("template=articles"); foreach($articlesItems as $articlesItem) { ?> <div class="articlePost"> <h3 id="<?php echo $articlesItem->id; ?>"><?php echo $articlesItem->title; ?></h3> <?php echo $articlesItem->article_maintext; ?> </div><!--articlePost ends--> <?php } ?> </div><!--articlesContainer ends--> <!-- On your template/page that holds the teaser links you need to generate the hashtagged links to the h3 id, set above. Do not copy paste but incorporate into your logic. Example below (untested): --> <?php $teaserLinks = $pages->find("template=articles"); foreach($teaserLinks as $teaserLink) { echo "<a href='" . $pages->get("/path/to/full_article_page/")->url . '#' . $teaserLink->id . "'>Read more</a>"; } ?>
  18. You can do it with plain old html. You can use a so called fragment identifier to navigate to locations within a html page. Just generate your links like so: mysite.com/articlecontainer/#location1 And then on the article container page put id's for each article: <h1 id=location1>First article title</h1> Repeat for every article, using PHP to automate this. Note the hashtag on the end of the url, this the fragment identifier. Of course, choose names and elements that make sense to you.
  19. On a sidenote I just noticed that the Markdown Extra textformatter uses a quite old Markdown parser. I'm not sure if this module is used a lot but maybe it would be beneficial to update to a more modern, actively developed Markdown parser like http://parsedown.org/ , which also has a Markdown Extra extension. It seems to be fast as well: http://kzykhys.com/blog/benchmarked-markdown-parsers-written-in-php/
  20. Hitting these kinds of roadblocks makes you better in the long run. At some point you'll never forget that when file or image fields are set to allow more then 1 file/image, you'll have to iterate over them because they are a WireArray. Or use a method like adrian showed. Also, this concept is explained at the start of the images documentation you referred to. One of the most common sources of confusion here on the forums .
  21. Another thing: have you tried disabling the TextFormatters one by one to check if one of them is actually causing problems?
  22. I just copied and pasted your code into a test template on a page with a sidebar field of type textarea, and it works as expected. If the field is empty nothing is being output. Are you sure that there is not some stray whitespace or another invisible character in your sidebar field? Maybe check html view, or even in database. I don't have experience with the modules you mention but i don't think they would be causing this.
  23. Peter has got it running using HannaCode, https://processwire.com/talk/topic/3745-hanna-code/?p=77895 To conclude: In general, never use the eval method mentioned here people!
  24. It's possible, only not recommended. Take a look at this thread https://processwire.com/talk/topic/3004-is-there-any-way-to-execute-php-loaded-from-textarea-fields/?p=29541 If you lose the opening and closing PHP tags in your 'Inject Include' code, you can use php eval, http://php.net/manual/en/function.eval.php to execute the code in the template. But you really should be using Hanna (which should work also in 2.5.5) or maybe http://modules.processwire.com/modules/markup-shortcodes/
  25. SiNNuT

    Hanna Code

    I don't have any problems running HannaCode on my 2.5.5 dev environment. Have you made sure that Hanna Code Text Formatter is applied to the field(s) that you put a Hanna on?
×
×
  • Create New...