Jump to content

netcarver

PW-Moderators
  • Posts

    2,136
  • Joined

  • Last visited

  • Days Won

    42

Community Answers

  1. netcarver's post in strange date frontend behaviour was marked as the answer   
    I'm guessing, and this might not help much, but it sounds like output formatting might be off when you are not logged in.
  2. netcarver's post in CTRL + S was marked as the answer   
    http://modules.processwire.com/modules/admin-hot-keys/
  3. netcarver's post in New install over virtual host - only home page runs! was marked as the answer   
    @zota
    Welcome to processwire. There's a tutorial here that might help.
  4. netcarver's post in Call Class functions/methods via URL was marked as the answer   
    Hi salepg,
    Check out URL segments.
  5. netcarver's post in get url that user entered your site from. was marked as the answer   
    You can get it in a PHP section of your template files like this...
    $ref = $_SERVER['HTTP_REFERER']; Be aware that this variable can be unreliable as it is up to the visiting browser to send it and it can also be forged. Most of the time it will be correct though. More info here.
  6. netcarver's post in Hide pages/branches of the page tree for users with certain roles. was marked as the answer   
    Congrats Kongondo. Looks like your link has solved this for me. I'll just take a few minutes to verify and hopefully post a full solution later.
    Edited to add: Yes, the solution was found in Soma's post here. He links to a module he posted to gist and that works great for me.
  7. netcarver's post in Can't detect empty field was marked as the answer   
    So doesn't this solve your problem...
    <?php if (strlen(trim($page->sidebar)) > 0): ?> <div class="sidebarItem"><?php echo "$page->sidebar"; ?></div> <?php endif; ?> ...?
  8. netcarver's post in Renaming the "content" tab when editing pages of a given template was marked as the answer   
    Ok, as promised, here's my solution.
    public function init() { wire()->addHookAfter("ProcessPageEdit::execute", $this, "tryThis"); } public function tryThis(HookEvent $event) { $render = $event->return; $template_name = "xyz"; // Change this to match the exact template name of pages you want to apply tab-renaming to. if (false !== strpos($render, "template_{$template_name} ")) { $render = str_replace("Content</a>", "New Title</a>", $render); $event->return = $render; } } I'm not totally satisfied with it as it makes no allowance for possible changes to the default string or the internationalisation of it - but it is still relatively easy in PW. I've raised an issue about this over on the home repo as I think PW should be able to solve this more elegantly.

    It will do for this current site as I only expect to use the English default string for the content tab.
  9. netcarver's post in AsmSelect + PageField Modify Selected Options Order In Select Dropdown was marked as the answer   
    After a nights sleep I've figured it out. It was indeed the rendering of the options in the underlying select that was the issue. Commenting out lines 57-64 of InputfieldAsmSelect ___render() fixes it for me. I'll now hook that method to provide my own implementation that doesn't put all the selected options at the end.
    Hope that helps and thanks for looking 
  10. netcarver's post in Best Place in PW to have custom spl_autoload_register was marked as the answer   
    Well, the only place I can really think of is from your config.php file - but in that case you might as well just put your spl_autoload_register() directly in there.
    Should be safe from core upgrades too.
  11. netcarver's post in How to get unique field values from a nested foreach was marked as the answer   
    How about this (untested)...
    $categories = $page->children; /** * This will hold unique values from the possible repeats in your page tree... */ $uniques = array(); /** * Iterate as you did before but only keep one copy of each category you visit. */ foreach ($categories as $category) { $categoryNames = $category->categories; foreach ($categoryNames as $categoryName) { $uniques[$categoryName->id] = $categoryName->title; } } /** * Now do what you want with the uniques. They are indexed by page id. */ foreach ($uniques as $id => $title) { echo $title, "<br />\n"; } ...?
  12. netcarver's post in Http to https redirection is not working correctly was marked as the answer   
    Actually, you can do this from within PW itself without resorting to htaccess rewrites (if you want to.)
    Edit your templates and look at the URLs tab. There is a section there where you can define which scheme the page should be served as. Switch over each template representing pages that you need served via https and save them. Your pages should now be directly accessible via the https scheme and if you try to access them via http you should be redirected to https.
  13. netcarver's post in Problems With Textile Plugin was marked as the answer   
    Hi Gazley,
    I have an idea what this might be. Can you edit TextformatterTextile.module and comment out the 'requires' line...
    // 'requires' => 'PHP>=5.3.0' ...save the file and reload the modules page. Let me know if that fixes the issue for you.
  14. netcarver's post in Rewrite URL - strange behaviour was marked as the answer   
    Guys, sorry to hear about the issue. I've never used RewriteBase before so I can't simply answer this but it strikes me there must be something @DV-JF can identify that's different between his two test sites.
    Firstly, how is the neu subdomain .htaccess different from the main domain .htaccess? Are you using RewriteBase in the subdomain case?
    Secondly, what version of PW are you running?
    Thirdly, I assume that commenting out RewriteBase in your .htaccess file and restarting the server causes PW's admin interface to stop working?
    Edited to add 1: It seems to me that RewriteBase only changes how the path part of a url is handled yet you are seeing problems with the domain part. I suspect this is some combination of your site's virtual host entry + file layout problem + .htaccess rather than something major in PW but I could be wrong.
    Edited to add 2: Are you 100% sure you ftp'd up a .htaccess file into www/sports-vitality.de/? and that it's readable by the webserver process? Also, is there a .htaccess file in www/? I see from Stack Overflow that you can get double domain parts if you are missing a readable .htaccess where you expect it (or it doesn't have mod_rewrite info) but one exists in the parent directory.
  15. netcarver's post in my .gitignore file is being ignored - Why? was marked as the answer   
    @OrganizedFellow,
    Question: Did you start off without a .gitignore file in your project root and add it at a later date? Possibly after an initial add and commit on your project? If so, git will continue to track what is already in the index - regardless of the content of your .gitignore file. More details here.
×
×
  • Create New...