Jump to content

SiNNuT

PW-Moderators
  • Posts

    1,011
  • Joined

  • Last visited

  • Days Won

    8

Community Answers

  1. SiNNuT's post in php.ini in webroot breaks site - Internal server error was marked as the answer   
    Have you instead of php.ini tried putting the settings in a file called .user.ini placed in your public_html? I mention this because i see a reference to this in the phpinfo().
  2. SiNNuT's post in Reuse content from field was marked as the answer   
    For fields you can get stuff like names, id, labels and such but not content values. For that you need to get a page by id, path or selector. Something like this:
    echo $pages->get('/')->home_tekst_8;
  3. SiNNuT's post in Ajax Contact Form was marked as the answer   
    It seems your contact.php is unfamiliar with PW, so it does not know about $sanitizer. You should put your php code in a template file,or include it via one of the ways (template, init etc.). Or bootstrap PW in contact.php, https://processwire.com/api/include/
  4. SiNNuT's post in Suddenly Sloooow was marked as the answer   
    Probably, otherwise there would be no reason for the code to slow things down. It should be noted that this code should only be run after one has created a bunch of multilang pages from the API.
  5. SiNNuT's post in How do I activate reno theme? was marked as the answer   
    1 Enable/install Reno, under modules->core->admin
    2 Go to your user profile and select Reno for the Admin Theme setting
    Yes, Reno is the profile in use on the demo. The Admin Theme setting is on a per user basis.
  6. SiNNuT's post in Help getting started with textformatters was marked as the answer   
    Maybe Teppo's article can help:
    http://www.flamingruby.com/blog/taking-apart-a-simple-textformatter-module/
    It's from 2013 but it still is all valid i think.
  7. SiNNuT's post in Virtual tree was marked as the answer   
    I'm not quite sure what you are getting at by the virtual part but it is possible since a while to have users under different parents.
    http://processwire.com/blog/posts/processwire-core-updates-2.5.14/
  8. SiNNuT's post in Intermediate profile - Summary not displaying was marked as the answer   
    You can re-use page fields as many times as you want. If the content of the summary field suits your needs you can also echo it in other parts of the template file (or _main.php) . For it to be visible 'onscreen' it needs to be output somewhere between the html body, in a place of your liking.
  9. SiNNuT's post in import pages by csv - how to create tags in page fields from this? was marked as the answer   
    Adding the page references via the csv module was/is allready possible:
    https://processwire.com/talk/topic/383-module-import-pages-from-csv-file/page-4#entry21476. And now apparently also via titles, as LostKobrkai points out.
    But i think you also want to create the tag pages (under a different parent) on the fly with this module. I'm not sure but i don't think this is possible.
    A solution would be to grab all the unique tags from your csv and import the tags seperately. Ah, MuchDev already said it.
    After that import the gallery items with the page (tag) references like above link.
  10. SiNNuT's post in unique fields? was marked as the answer   
    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
  11. SiNNuT's post in Add PHP include to field was marked as the answer   
    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!
  12. SiNNuT's post in Output just month from date field was marked as the answer   
    Something like this should work
    <?php $tests = $pages->find("template=detail-testimonial, sort=-date"); foreach ($tests as $test) { $mydate = date("F", $test->getUnformatted("testimonial_date")); echo "{$mydate}<br/><h3>{$test->title}</h3><p>{$test->testimonial_body}</p><hr/>"; } Actually, i'm not sure that setting an extra var ($mydate) would be most efficient. You can also do it directly and then concatenate your stuff together.
  13. SiNNuT's post in Get page with selector fails in non default language was marked as the answer   
    If a page is not active for your secondary language there is nothing to find/get in that language.
    If you create orders via the API you can set a language active via this:
    https://processwire.com/talk/topic/4383-how-to-set-language-active-via-api/
    Pages created via the PW admin should already activate all languages by default.
  14. SiNNuT's post in problems with forum New Content was marked as the answer   
    I don't have problems with it?
    Have you by any chance accidentally clicked some of the Other options? This gotcha hit me in the past (as well)
    Other Just items I follow Items I participated in Items I started
  15. SiNNuT's post in selector quotes with variable was marked as the answer   
    It's not an issue, it's just how PHP handles things, and is not specific to PW.
    Variables will not get evaluated inside single quoted strings.
    edit: for future reference: http://php.net/manual/en/language.types.string.php
  16. SiNNuT's post in One page websites was marked as the answer   
    What you are thinking is something that certainly is not wrong and should work fine, and this has also been discussed in the past on this forum.
    The native forum search isn't the best but if you do a Google search like this 'site:processwire.com/talk single page website' you should get some interesting results.
    Stuff like this could be good reads for you to get some inspiration:
    https://processwire.com/talk/topic/1283-a-single-page-site-using-pw/
    https://processwire.com/talk/topic/5919-hide-children-of-home-from-indexing-single-page-site/
    https://processwire.com/talk/topic/2845-single-page-websites/
    https://processwire.com/talk/topic/3036-one-page-website-template-setup/
  17. SiNNuT's post in Only "year" in Datetime field? was marked as the answer   
    I'm not sure but i think your out of luck with a Datetime field. As far as i know this will always require some form of date input, not just a year (which of course isn't a date). Maybe someone who has done more with Datetime fields can verify or prove me wrong.
    What i would do however is simply make a field of Type = Text. When you have saved the field you can go to the Input tab and use a pattern of your liking.
    For example if you wanted to only allow years in the range 1900-2100 you could use a pattern like this:
    ^(19[0-9]{2}|20[0-9]{2}|2100)$ When a customer tries to enter anything that falls out of this range and hits save there even is a nice client side inline error message (in capable browsers) or else there will be server-side validation. Of course, you should make a regex that suits your needs.
    You will be able to sort pages according to year via such a setup, in the page tree as well as on the front-end using PW selectors.
    EDIT
    You can also use the Integer type, where you can optionally set (on the Input tab) the Numeric Input Type to Number (HTML5) and set a Minimum and Maximum Value. This gives a nice input to the customer and with the same nice html5 validations.
    The Integer type might be preferable, because of the nice input but also database efficiency.
  18. SiNNuT's post in how to use checkbox was marked as the answer   
    <?php
    if ($page->check == 1) // 1 is checked, 0 is unchecked
    echo "some text";
    echo $page->sometextfield;
    ?>
  19. SiNNuT's post in Can you move pages in to other tree? was marked as the answer   
    It's either what adrian said, the destination parent page does not allow pages with the template of the page you are trying to move, or the template of the page you are trying to move has a setting for 'Allowed template(s) for parents' that restricts you from moving it.
    Have you checked all of the template settings on the family tab of the templates involved?
  20. SiNNuT's post in PW without domain was marked as the answer   
    This sounds like some typical .htaccess rewritebase stuff. Look in that file for pointers. Also try searching this forum because the subject of installing PW in a subfolder and whatnot has come up quite often.
  21. SiNNuT's post in returned page title with this> - <inside ? was marked as the answer   
    No, $page->name is used in the url of a PW page. Spaces are not allowed in a url. What you are probably looking for is $page->title.
  22. SiNNuT's post in Pointers for using PDO was marked as the answer   
    I'm far from a guru (but pete probably is ) but glad to be of help sometimes. I'm sure you are more than capable of googling PDO, but i wanted to mention there are some good intro/tutorials around like this one http://code.tutsplus.com/tutorials/php-database-access-are-you-doing-it-correctly--net-25338
    It's really not hard once you get the concept.
  23. SiNNuT's post in Session Handler Database - do not delete old sessions was marked as the answer   
    I believe in one of the posts about session files not getting deleted Ryan mentioned that the database session handler also relies on the native PHP garbage collection. On some Ubuntu servers, with default settings php gc does not run. Maybe you're on a ubuntu server as well?
    http://processwire.com/talk/topic/5787-sessions-thousands-of-them/?fromsearch=1
  24. SiNNuT's post in 12 times a text field ? was marked as the answer   
    Yes, and that's where javascript (jQuery, plain js or other libraries) comes in. On the home page you use PHP and the PW api to list all of the Left column and all of the Middle column, with some correct markup for javascript to do it's magic (step 1). You then use javascript to hide/show the content of the Middle column based on which anchor link is active in the Left column (step 2). The link i posted shows you an example of how to do such a thing. I can't provide you with a copy paste solution, but it in essence just a php foreach (using a PW selector) and some basic jQuery.
  25. SiNNuT's post in No requirment for db password while installion was marked as the answer   
    The password requirement has been retired for at least a couple of months now on the dev branch.
    https://github.com/ryancramerdesign/ProcessWire/issues/278
×
×
  • Create New...