Jump to content

kongondo

PW-Moderators
  • Content Count

    6,003
  • Joined

  • Last visited

  • Days Won

    98

kongondo last won the day on June 1

kongondo had the most liked content!

Community Reputation

6,714 Excellent

About kongondo

  • Rank
    Hero Member

Profile Information

  • Gender
    Not Telling
  • Location
    UK

Recent Profile Visitors

27,770 profile views
  1. Hi @MilenKo. Apologies for the late response. I am not sure what you mean by block title. However, this count() will not work: echo "This menu has: " . count($cat_menu); as $menu->render() returns a string. PHP will return 1 (a boolean) but if you had Tracy Debugger it would throw an error about using count() on a non-iterable variable. If you need to know the number of items you can use the method getMenuItems() introduced here and documented here. You can use the method to either return menu items as a an normal PHP array or as a WireArray. In the examples outlined in the first link above, you can use getMenuItems() with a custom recursive function to render your menu however you wish. In your case though, you can just use it to check number of items. For example: $mb = $modules->get('MarkupMenuBuilder'); $menuItemsAsArray = $mb->getMenuItems(1108, 1, $options);// param 2 = 1: return array $menuItemsAsObject = $mb->getMenuItems(1108, 2, $options);// param 2 = 2: return WireArray (the default) In case you just want to know if a menu item is not empty, you can simply check if the return value of $cat_menu is a string. For example: // Render the menu by title $cat_menu = $menu->render(1108, $options); if(is_string( $cat_menu)) { echo $cat_menu; } This, however, will not give you the count as explained above. You'd need getMenuItems() for that. In case you want to know if a menu item is a parent/has children, etc, you can use the WireArray option of getMenuItems() as shown above and use ProcessWire WireArray methods to filter items. For instance: $someChildItems = $menuItemsAsObject->find("parentID=2"); // OR $someParents = $menuItemsAsObject->find("isParent=1"); $someChildItems = $menuItemsAsObject->find("parentID=2"); I hope this helps.
  2. OK. However, my point was that multisite option #1 works with subdomains as well ๐Ÿ˜‰. Yes but to some extent No. Let me explain: Core Modules (e.g. AdminThemeUikit) will be physically shared between the sites since they live under wire/modules. By physical is meant the module files. However, optional core modules such as AdminThemeUiKit can be installed in some site-* but not others. Since site-* each have their own databases, site-a might have AdminThemeUikit installed whereas site-b might not. Install just means a reference to the installed module in a site's database. Custom modules, i.e. those that live in site-*/modules are not physically shared. Unless you are using symbolic links (which can be problematic!) each site-* will have its own modules folder. This means site-a/modules can have SomeModule and site-b/modules can also have the identical or same SomeModule. Of course, their respective databases will have references to their respective SomeModule. So, back to your problem. Did you physically copy AdminThemeUiKit to both your site/modules and site-stirnweiss/modules? This is in addition to the core copy in wire/modules/AdminTheme. If you did so, that is wholly unnecessary. If the answer is no, then you are experiencing a different problem, maybe a server configuration issue. It's hard to tell without more information about the 500 errors (apache logs, ProcessWire error logs, etc.
  3. Subdomains work fine for me. Maybe you are a having a 'www' issue? Does this not work? sub.mydomain.de
  4. Hi @nurkka. Sorry for the late response. I have been away. This is an excellent suggestion! I'll have a think on how to best implement it but theoretically, it is doable. Another great suggestion! I would have to rethink the GUI a bit since tabs (Filter: Icons, Filter:Photos, etc) would quickly become unwieldy. On a related note, I have been planning to refactor the items shown in the Inputfield Selector (the filters) as there are a number of things not directly relevant to Media Manager that would confuse editors. For instance, the Inputfield shows non-Media Manager fields, items like Path/URL, etc. I am planning to work on your suggestions and the refactoring in the next update. I might call on you for a bit of testing before release, if that's OK. Thanks.
  5. That's what @elabx said! :-) ๐Ÿ˜๐Ÿ˜ Good to see you (again) as always ๐Ÿ˜‚.
  6. @elabx was right :-) Here't two ways in addition to @dragan's above: Method 1: Call Hanna inside your function function SomeFunction(){ $out ="<div>"; // hanna in here $hanna = wire('modules')->get('TextformatterHannaCode');// @note: wire! $out .= $hanna->render("[[hello]]"); $out .="</div>"; return $out; } $out = SomeFunction(); echo $out; Method 2: Pass your function an argument/parameter with Hanna rendered output $hanna = $modules->get('TextformatterHannaCode'); $hannaString = $hanna->render("[[hello]]"); function SomeFunction2($string){ $out ="<div>"; // hanna in here $out .= $string; $out .="</div>"; return $out; } $out = SomeFunction2($hannaString); echo $out;
  7. Great! I am glad it got resolved!
  8. @Ben Sayers, I hope you can forgive my 'ineptitude'. I have been royally swamped. I tried to install Jumplinks but was inundated with the errors reported by others above, so I gave up on that. Anyway, that was just for testing redirects. My solution below, since Jumplinks isn't working for me (I tried all the way back to version 1.5.50), is to use ProcessWire session redirects. I don't know what that means for you in respect of SEO. I hope I am not polluting Jumplinks' support forum but I need to offer a bit of an explanation. The template blog-posts has URL segments enabled. If you visit: domain.tld/blog/posts/an-existing-post/ ProcessWire successfully resolves that since 'an-existing-post' exists. In other words, 'an-existing-post' is not considered a URL segment. If you visit: domain.tld/blog/posts/non-existent-post/ the URL does not resolve to an existing post. ProcessWire knows that and considers 'non-existing-post' to be a URL Segment. However, since we have URL segments enabled in blog-posts, ProcessWire lets us deal with the situation. We do this in blog-posts template file. I don't know how Jumplinks works but I assume if we threw a 404 error, it will pick up on that and redirect to our desired URI. Again, I am just guessing here. However, since Jumplinks did not work for me, I suggest the following (session redirect), even as a temporary measure. You can try the 404 option to see if it works. Please report back, thanks. At the top of your blog-posts template file, insert the following, just above your first include: if($input->urlSegment1) { // @todo: test this with Jumplinks. In that case, comment out "session" code below //throw new Wire404Exception(); // redirect to main blog page. if using this, comment out 404 exception code above $session->redirect('/blog/'); } include('./_head.php'); // include header markup I hope this helps. Apologies again for the delay.
  9. Hi @Ben Sayers. Actually, yes, I have. I was to write something earlier this week but didn't get time to get to it. I have two suggestions. Could I please get back to you here over the weekend? Thanks.
  10. I edited this to read "posts" NOT "post" to avoid further confusion ๐Ÿ˜ƒ. I think the key is in what @teppo stated above: Your blog-posts template (file) is not throwing a 404 exception for the missing (deleted) posts. I am not sure whether manually throwing a 404 will resolved the issue but I am sure the other guys will have better knowledge of this. Meanwhile, please show us the contents of your blog-posts template file.
  11. @teppo, @Ben Sayers, Given my conversation with Ben in the blog module forum and given the correction made therein (?what?) and given Teppo's suspicion of URL Segments, I now wonder whether Ben's issue has to do with the term 'blog' at all. I suspect it is the 'posts' in the URL Segment since the posts templates utilises URL Segments as I listed above. Edit: for clarification, Ben's correct address to the blog posts, is, f.ex. domain.com/blog/posts/some-post/
  12. Please confirm this. According to your post here: it seems your posts are structured as: (domain.com/blog/some-post/). This would make it a Blog Style 2 and not Blog Style 1 which would be structured as: /domain.com/blog/posts/some-post/
  13. Blog has only one hook, used in the backend, limited to save of a single blog post (addHookAfter) to set its blog published date (@note: this is NOT the PW published field but the blog pages date field) The following blog templates have URL segments enabled: Blog Archives (blog-archives) [virtual parent of blog archives; virtual since no real children; works becaue of URL Segments] Blog Authors (blog-authors) [virtual parent of blog authors; can also display multiple authors] Blog Comments (List) (blog-comments) [virtual parent of blog comments; can also display multiple comments] Blog Posts (blog-posts) [parent of posts; can also display all posts] Blog Tag (blog-tag) [a single blog tag] Cross-reference
ร—
ร—
  • Create New...