Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. When I try to create a simple breadcrumb: $userLang = ''; if(!$user->language->isDefault()) $userLang = $user->language->name; foreach($parents as $parent) { $url = $parent->url . $userLang; echo "<li><a href='$url'>{$parent->title}</a></li>\n"; } The home-link (top parent) looks OK in the generated breadcrumbs, but I get redirected to an URL "fr/" - that's it. No domain whatsoever. I guess that's a bug, not a feature?
  2. Ryan, Thanks again for your PMs and for writing a new multilang tutorial. Sadly, using your language switcher doesn't work. If I am on a /fr/ page, it shows links to the default language URLs. All language support modules, incl. the new Page Names module, are installed. I have an include file at the very top that defines languages, according to URL-segments. When creating links as you described, simply with the API (appending $lang to $page->url) works nicely. The MarkupSimpleNavigation module, however, doesn't do that on its own. That's probably because it was written before 2.3.2. May I ask you how you generated navigations for Tripsite? i.e. did you use MarkupSimpleNavigation at all, or roll your own? A few "real-world" examples would be nice.
  3. All of a sudden I get this error: PW 2.3.2 (latest dev version). I have no idea what that means. Strangely enough, it used to work. I just do echo $page->sidebar nothing fancy there...
  4. It's possible to create a PHP file that serves as CSS. Make sure you add something like this at the very top (headers) <?php header("Content-type: text/css; charset: UTF-8"); ?> If you place such a file in site/templates/ (with .php suffix), PW will most likely guess this is a template file though. Maybe there will be conflicts when you (the browser) attempts to access this .php file directly. Guess it's worth a little test though... edit: sorry, teppo was faster than me I agree - if you can avoid such "php serving as css" tricks, better stick to some other method...
  5. I am using example 1 setup from http://processwire.com/api/multi-language-support/multi-language-fields/#examples No separate page-trees per language. There is a URL segment, and if I switch from pagename/de/ to pagename/fr/, the content does show french language content. That is all working nice and dandy. But the various scripts which generate links do not "recognize" in which language I am currently. I'd like PW to somehow recognize which types of links to render for me, based on the current user language. If I use a simple API call to get all parent x children and output $page->url - these links should point the user to the current language URL, not the default URL. PW doesn't add the necessary language URL-segment on its own. I don't know if it's supposed to do that, I'm just asking. Is it necessary to add / inject something like if($input->urlSegment1 == 'en') { // do this or that } to API calls? I already define such stuff at the very top of my header.inc for various purposes (and that is all working as it should). It's probably just one tiny thing I'm overseeing, and I'm sure similar stuff has been done many times before...
  6. Since English is not my native language, my question was perhaps not clear enough. I'll try and rephrase my question: With a multilingual PW setup, is there a "standard" (in-built) way to tell PW "I want to create a link list, for the specific language the user has selected"? These links, which I generate with standard PW API methods, should point the user to his / her language-specific pages, not the default language pages. If the current user-language is known - let's say my last URL-segment is /fr - the user shouldn't get links to the default language links, but the links of his own language. Sure, I can manually str_replace() URLs and construct links for each site-language, but that seems quite awkward. I try to figure out a way to handle this "the PW way", and I'd be glad for tips and pointers... After all, I guess I'm not the 1st guy building a multilang site with PW and facing the same problems?
  7. I've been reading docs and forum entries, but I am still scratching my bald head about this... I have a multilang site with 4 languages, and the whole PW-setup is the "last URL segment" variety. (i.e. no subdomain. No entire, separate page-tree per language either). There's about 4 areas where I need to create navigations: main nav at the top, another on the left, footer links + breadcrumbs. If I switch from any language to the other, those navigation items don't respect the current language. i.e. if I am on mysite.com/about/hello/fr/ (french) I expected that all the various navigation items (links) would automagically produce also links for their french pages. But what it does, is just "fall back" to the default language URL. Are there any "best practices" / tutorials that I have missed? What's the most clever way to show the user automatically a navigation in the current language? Sessions? (I am using both Soma's MarkupSimpleNavigation module and plain-jane PW API funcs, if that matters.)
  8. btw, I think MailChimp rolled out a new version recently. Quite possibly some API methods have changed I guess...
  9. I get an error @ http://domain.com/processwire/newsletter-mailchimp/ Error: Class 'MCAPI' not found (line 85 of ...site/modules/NewsletterMailChimp.module) Any idea why this could be?
  10. That's the right attitude And yes, nice site! Kudos.
  11. Yep, I'd guess that's the culprit too. I remember MODX Evo had similar problems (though I don't remember with which mySQL version exactly).
  12. Sorry for replying back so late, but it's been a hectic (and hot) week... I guess the reason it didn't work, was simply because some pages didn't have the correct / updated template .php assigned, and thus missing a newer include file. Mea culpa! Thou shalt not multitask, unless you are a machine. <slighlty off-topic> Seriously now - I really believe multitasking should be left to computers, not humans. I guess I was trying to build / fix / update too many things at once. And as is always the case in such situtations, small (but important) details get easily overlooked. </slighlty off-topic>
  13. Actually, I'm beginning to believe it's a server issue. On another site / server it's working perfectly. Could a multilingual site setup be a potential error source? (I wouldn't know why that would be the case, everything looks perfectly OK - just clutching at straws here...)
  14. Quite possible. The devil is always in the details. Thanks for your clarifications though. Will try again today with more caffeine
  15. OK, I'll try to rephrase it. I have this in leftnav.inc: $leftNav = $modules->get("MarkupSimpleNavigation"); $leftNavOptions = array( 'max_levels' => 3, 'collapsed' => true, // I guess this is the param that's not being executed correctly atm... 'show_root' => false ); echo $leftNav->render($leftNavOptions); For simplicity's sake, let's say I have this basic 08-15 site structure: - Company - Products - Downloads / Manuals - News Each of these main sections has sub-sections: max. 2 levels down. Now, no matter if I'm at the root page of "products", or in a detail-page within products, the menu always outputs the entire tree. Like a sitemap, everything from A to Z. But that's not what I want. Shouldn't "collapsed = false" take care of that? The idea is to have a basic HTML list that only displays the top-level hierarchy as links. But when I'm further down in level 1-2-3, it should recognize this... "ah, that's my home category, let's open up this navigation tree as well to show where we live". Right now, all levels / sections are open all the time, at all levels, everywhere. "Collapsed" parameter true or false: doesn't change anything. So e.g. if I'm visiting a product page (= 1 level down inside "products"), it should only render: - Company - Products -- product A -- product B (= active) -- product C - Downloads / Manuals - News But what the module actually does, is showing every single page, no matter how far up or down you currently are. Surely that was not the intention of the module? So either I'm completely misunderstanding how this module is supposed to work, or it's some kind of bug. I'm sure I could visually hide the superflous elements via CSS, but I'd rather have the module not render them in the first place... in a nutshell: a) show only top-level links + b) but also show (nested) sub-levels if I am in inside this parent category, right down to the child (or grand-child document).
  16. Well, every single page is being rendered as list / link, not just the top most hierarchy.
  17. If I only want to show the top-level items, what would be the correct options? I tried 'max_levels' => 1, 'levels' => false, 'collapsed' => true, but I still get all items. Is this module "overkill" if I only want to list topmost pages? Should I be better just using a simple selector and foreach, to output such a simple nav-list?
  18. Was looking for that feature as well, and found this thread. Works like a charm with purl.js + highlight.js!
  19. It was with trailing slash (apart from CSS copied from sample install). Perhaps a little note in the docs wouldn't hurt, that's why I added my last comment. Just in case someone else stumbles upon similar gotchas tl;dr: Rename your id 1 page, and GET params won't get passed along anymore.
  20. I can now replicate this behaviour: When you rename the "name" field of the home page (the URL alias), the GET parameter never arrives. That's probably what you meant with Is this a bug or feature? Anyway, I'll better leave the homepage (id 1) as is in the future, i.e. blank (/).
  21. Nice. Just used this button for the first time
  22. Nice! I now added the JS and CSS bits in BOTH wire + site folders. Just placing them in one or the other didn't. This is cool. Works like a charm. Thanks again!
  23. Thanks! I really appreciate the time you took for this. After all, it would only be a "nice to have" feature, nothing else. I tried to add the CSS and JS now, but it doesn't work. Google Chrome console shows a JS error: Uncaught TypeError: Cannot read property 'length' of null in wire/modules/Jquery/JqueryCore/JqueryCore.js?v=183 Where did you add your last JS code? in main.js, install.js or inputfields.js? I tried it in the latter two, but it didn't make any difference. (latest stable 2.3.0 install here, if that matters...)
  24. Thanks. I never really knew about fieldset_open / fieldset_end. Stumbled over this forum thread also: http://processwire.com/talk/topic/665-editing-fieldsets/ It will surely come in handy at some point. Although I do save some space now, I still didn't find a way to actually be able to display image thumbnails next to each other (3 or 4 in a row). Is that somehow possible? e.g. I have two fieldsets: content 33% (everything else than images) + images 67%. But the thumbnails are still displayed one on each row. Is it not possible to change the CSS properties of the image input field? I tried editing .InputfieldImage in wire\modules\Inputfield\InputfieldImage\InputfieldImage.css with no luck
  25. I only now discovered that it's possible to declare individual input-field widths. Excellent feature! However, image-fields are not supported. Well, the fields are resized, but it seems to be still "display: block" i.e. each image-input field is displayed one below the other. With image-heavy pages, it would be cool to say e.g. "image input field: width: 33%" and being able to show more images per row. This would make sorting much easier. Right now I have to resize the browser content (CTRL -) so I can see more images per screen real estate. Even then, I have to often move an image up or down several times to reorder them. I guess all it would take is changing / adding a CSS property somewhere? e.g. from "display: block" to "display: inline" or similar.
×
×
  • Create New...