Jump to content

NoDice

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by NoDice

  1. Yea that is the slider, I am changing the arrows to my own design and I may go with different arrows depending on class of "dark" and "light" for the main image. I would like to have them all visible and manageable with all the rest of the content. I have similar background arrow-images for things like links, and I wan't to have all my custom site specific content visible and manageable from my content management system. At first I had these arrows on my banner-configt-page, but after changing that around a bit once, they disappeared (don't remember what I did, may have recreated it with the same fields, but I got a new number on the asset folder anyway - which I found out after having spent some time trying to figure out why the did not display). Anyway, I thought the whole point was having the images on content related pages of that kind, and if so, then looking for the asset folder number and linking them that way seems like a bad solution even if you never recreate or move stuff (which I am sure I will do). Now I have moved these images to a dedicated image page instead (with other similar graphics files), since I felt I had to do that to make sure they would not be moved by mistake again during production re-structuring. The image page setup will probably work, but if you have to do that anyway - and then make sure that page number stays the same for non managed part like CSS to work - why not have such a managed, non "changeable" asset folder (that is also an actual folder, say "media") where you always know the link from the start? To me it just makes more sense, but I am new at this so maybe I will see the light at some later stage.
  2. Well, then those images won't be visible or editable from the CMS, if I understand correctly? I certainly would have preferred to have them also visible and manageable from the CMS like other images. The first question was a while ago so this is more a follow up after still not having found a way that feels right.
  3. I have to say I am kind of still stuck on this topic, and the image-handling is the one thing I can't quite understand when it comes to pw. It seems to shaky (and may cause other problems). My problem is that the classes for hover-states for the flexslider carousel that I need to set background images for are dynamically produced by the plugin. You only style it by going into the standard supplied CSS to make alterations, so that is where I can change the images link for navigation direction for instance, to something I have made that better matches the overall design. I am just not sure how to deal with that. To me, it seems extremely basic to be able to handle background images from CSS as intended from the perspective of separation of design and markup. That this basic thing is a problem for processwire just can't be good from my admittedly extremely uneducated perspective. So how would you handle this? So far, during construction, I have put the image in a page and linked the asset folder by number after looking for it in the folder structure. However, since that can change number, that does not seem robust enough for production. At this stage, I am thinking of just making an image folder and just retreating images that the users will not touch from there completely outside the CMS. Since I use some background images for basic design, that could probably handle all of those so I could follow a principle (and separation of style guidelines) throughout; but, on the other hand, that would also kind of defeat the purpose of a CMS when it comes to handling all content. What does the forum suggest? And wouldn't it be reasonable to have at least one "fixed address" asset folder for files that can be called both from the CMS-framework AND from CSS for instance? Or am I still just missing something very basic here?
  4. You already helped way too much diogo! Also - this last bit worked in all its simplicity, don't know why I didn't think of that with all my attempts with else statements and such. Some people have followed the wiki so I think the problem could perhaps stem from the adaptations I have made to get multiple category tags working (with the help of Ryan). In the original wiki they used a single page category field. Anyway, the error it gone for now and everything works the way I want as far as the markup produced thanks to your help!
  5. Yea, so that explains why wire was used i guess (it was done as a function in the wiki). I will try to fiddle around and see if I can get it to display on another page. How to solve the error part, I don't get though. ***edit*** Got the display of the "breaking news" working on the home page with the help of your info (once I understood the wire part). Thanks diogo and kongondo! Missing variable error persist though.
  6. Thanks so much again diogo! Yea, as I wrote, I figured out that it is not being defined for the News page, the problem is that I have not been able to define it with an else statement (for when the page is the news page) or such to make the error go away. So the question would be how to do that? As for the wire part - this is all adapted from this wiki: http://wiki.processwire.com/index.php/Simple_News_System So not sure why wire was used (or why the part about not being the news page was defined the way it is), but I will try to change it!
  7. The title and heading is news and url is /news and all news items are displayed (which is what I want). When I click a category in the list, a new page with heading equal to the category is shown with only the news items tagged with that category listed. So, everything works just the way I want, just get that undefined variable "category" warning on that main news page. Another thing I have been having trouble with is getting a short version of the news-item list to be displayed on the home page. It does not seem to work with the same function. Could that be because of the wire-reference? Is there a way to change that to something more general in that case (so that you can use the function anywhere)?
  8. Well, I hope so, and with this one, at least I could figure right away what was going on. I Still don't get how I can solve the problem with the missing variable in post #17 though, I guess that is just a missing else statement somehow, but I can't make it work (it outputs all I wan't but can't get rid of the error code).
  9. Oh man, that is so great and simple, worked just like I wanted when implemented on all items! Thanks a ton - and sorry for not knowing even basic php! Starting to love this framework even without that knowledge though and your help is awesome.
  10. Also, as promised, the update on the dynamic repeating banner is that it works great! Here is the code I ended up with there if it can help anyone: <?php if (count($pages->get("/header-banner/")->repeater_header_banner_01)) { echo "<ul class='slides'>"; foreach ($pages->get("/header-banner/")->repeater_header_banner_01 as $banner) { echo "<li><img src='{$banner->header_banner_image_01->url}' alt=''><div class='banner_content'><div class='caption'><h2>{$banner->header_banner_heading_01}</h2>{$banner->header_banner_text_01}<a href='{$banner->link_01}' target='_blank'>{$banner->link_text_01}</a></div><div class='caption_description'>{$banner->header_banner_text_02}</div></li>"; } echo "</ul>"; } ?>The one problem I have left to solve are style issues from empty <a> and <p> tags when they are not used. What are the forums best ideas as far as solving that in a neat manner in a repeater contexts such as this? Checkboxes to add classes have come to mind, but perhaps there are better ideas out there?
  11. Thanks Ryan - that did the trick and checkboxes was just what I was looking for, much better than repeaters! Now I got the functionality all up and running with the multiple categories and all. The only problem remaining is an error code for missing variable ($category) on the main news page. The reason, from what I can gather, it only gets defined for when the page is not news. As stated, everything is presented as expected (with all posts on the news page, and the right ones under the category links), but even after trying all kinds of else-combinations and such to set it for when the page actully is News - I can't make the error code go away. Here is the code: function newsList(){ // Grab the page name from the url $thisCategory = wire("page")->name; // If the category is not called "news" then output the category name as a selector for the find. if($thisCategory !="news") { $category = "news_categories_01.name=" . $thisCategory; } // Get the news posts - limited to ten for later pagination $newsposts = wire("pages")->find("parent=/news_articles/, $category, template=news_01, limit=10"); $out =" "; //Loop through the pages foreach($newsposts as $newspost){ $out .="<div class='newsitem'>"; if($newspost->news_image_01){ $out .="<a href='{$newspost->news_image_01->url}' class=''>"; $out .="<img class='align_left' src='{$newspost->news_image_01->size(100,100)->url}'>"; $out .="</a>"; } $out .="<a href='{$newspost->url}'><h3>{$newspost->title}</h3></a>"; $out .="<p>{$newspost->summary_01}</p>"; $out .="</div>"; if (count($newspost->repeater_link_01)) { $out .="<ul class='links-list'>"; foreach ($newspost->repeater_link_01 as $link) { $out .="<li><a href='{$link->link_01}' target='_blank'>{$link->link_text_01}</a></li>"; } $out .= "</ul>"; } } // Pagination $out .="<div class='pagination'>"; $out .= $newsposts->renderPager(); $out .="</div>"; echo $out; } Any suggestions from anyone? Please feel free to point out anything else that could be done in a better way.
  12. Thanks so much for taking the time to reply Ryan - and for putting this great product out there! The repeater I used on the news item page template to be able ta associate a post with more than one category. How would I do that in a straightforward manner without a repeater? There is a lot I am not getting still so really very grateful for any nudges in the right direction. The naming is just an easy way for me to recognize all the fields and templates I have created + it helps when you need a second text field etc.
  13. I also ran into this issue and, in case someone else does too, it might be worth pointing out once again that this is not the value to change. At the end of the php.ini-file (that you find under the wamp-icon in the task-bar and then by in the menu picking PHP - php.ini) you have the xdebug lines. Just add the line... xdebug.max_nesting_level = 200 ...directly under the [xdebug]-line. After that, things should run smoothly.
  14. OK team, I finally had time to start work on the repeaters and have got things going as far as displaying the links just the way I wanted. What I have not been able to figure out is how to use the repeater-field I have created to be able to give news items more than one category per item. I have also tried to follow this tutorial for the overall structure: http://wiki.processwire.com/index.php/Simple_News_System But I have created a repeater field - repeater_news_category_01 - consisting of the category field news_category_01 to be able to add more than one category to a post. I saw in another post that Ryan questioned the syntax in the wiki-tutorial above, and in case it is not good - it would be really nice to point that out for us newbies trying to get into this by using the available wikis and tutorials. Anyway, I have got the category list working, and the news item displaying the way they should, but I have not been able to figure out how to deal with the multiple categories. As things stand, the category pages show all news items (not only the ones associated with that category. Any pointers (including veiws on syntax in the tutorial or my adaptation) would be much appreciated. Here is the code I have now: function newsList(){ // Grab the page name from the url $thisCategory = wire("page")->name; // If the category is not called "news" then output the category name as a selector for the find. $category = "repeater_news_category_01.name=" . $thisCategory; // Get the news posts - limited to ten for later pagination $newsposts = wire("pages")->find("parent=/news_articles/, $category, template=news_01, limit=10"); $out =" "; //Loop through the pages foreach($newsposts as $newspost){ $out .="<div class='newsitem'>"; if($newspost->news_image_01){ $out .="<a href='{$newspost->news_image_01->url}' class=''>"; $out .="<img class='align_left' src='{$newspost->news_image_01->size(100,100)->url}'>"; $out .="</a>"; } $out .="<a href='{$newspost->url}'><h3>{$newspost->title}</h3></a>"; $out .="<p>{$newspost->summary_01}</p>"; $out .="</div>"; if (count($newspost->repeater_link_01)) { $out .="<ul class='links-list'>"; foreach ($newspost->repeater_link_01 as $link) { $out .="<li><a href='{$link->link_01}'>{$link->text_01}</a></li>"; } $out .= "</ul>"; } } // Pagination $out .="<div class='pagination'>"; $out .= $newsposts->renderPager(); $out .="</div>"; echo $out; } Note that for now, I chose to remove most of the "not called news" part from the tutorial since it just gave me a missing definition of $category for the actual news page. Once again, what I am after is having the category links work so that they list only the category associated posts using my repeater as described above.
  15. Thanks so much guys - you rule! Will get on it in the coming weeks and let you know how I fare!
  16. Absolutely, and you are right of course, I am talking about a tags, and the fact that I am surprised they are not part of the standard set of fields. To me, that seems quite strange as I would imagine it is used quite often and since I see no super solid work around (where there really should not need to be one). Very grateful for the tips about repeater fields and such - will look into those and try to decide if they will suit my needs. I certainly think they may be the ticket for my other problem but since I have not worked with php before, I have to figure out how to achieve what I am after there. In fact, I'll tell you how I have it set up now and what I am after, and see if you have any views on how the best deal with the problem. I have a slider/carousel set up with caption texts tied to the respective slides that I format to overlay the slides. The slider employs the typical basic unordered list structure. My first hand preference would be to have one admin page for the slider so that I can see all the thumbnails for the slides in one page, so whomever is administrating the slider does not have to go into several pages just to check the order of the pictures and such. IE to not use child pages as I assume would be the normal goto solution for PW. The text needs to be clearly tied to each slide so the way I have done that now is to make 10 numbered instances each of every field (image, heading, caption text) to be able to put them all in one template that I then use as a basis for a hidden page. I have also created 10 li objects with the right php-urls for the content, but the major drawback is that as things stand, I have to go in and comment and uncomment the pre-prepared but sometimes unused li items (when I have fewer slides than 10). The li objects also have classes set for styling purposes. Naturally, the need to mess with the html in the template file is not desired, but that's where I am at now. The question is if anyone has a good idea on how to achieve the desired result with only one admin page where I can add more slides that would also generate correctly formatted li objects with classes and links to the new picture, heading, text? So, are repeaters the thing I need here as well? If I could get it the way I really want, having the possibility of adding one link per slide, with text description, would be great here as well (so once again, a generic a tag field would have rocked). Hope you understand what I am after, but please ask if you want me to provide more details or code snippets. Cheers from a hot and beautiful Sicily!
  17. Also, maybe there is no problem with empty links here since nothing will be added to the markup if they are empty. I have been working on a similar problem where I get unwanted empty list items, so I may have been confusing matters a little. I may make a separate post about that when time arises. Will do some more testing - in the meantime, thanks so much for your replies!
  18. OK, thanks my fellow Nordic PW:er to the east for coming with a prompt reply again! I had those workarounds figured, but I have to say that it kind of surprises me that this is not a standard option of the predefined url-field since it would seem to me that more strict markup related things are included in other field types by default, such as the possibility to set heading type with tinyMCE. What I want to do is have the possibility to add a couple of links (4 max) to the end of a news post area. The links will therefore be part of a news article template with pictures and such. The problem of the first approach is - of course - that I wan't people with no knowledge of HTML to be able to input the url and the text in a simple and understandable way (hence not HTML). That is one of the major reasons I am putting in the effort of adopting a CMS structure. The problem with the second approach, as far as I can tell, is that I will have to write more complex php to have the markup links only be included in the markup if I have links/text written in (and only for the number that I do, normally less than the possible four) - but not included if I do not - if I want the page to work. Otherwise I will end up with 1-4 missing links I have not filled them all out, which will be the normal case. Once again, to me it appears that this is such a standard URL-field feature (and one you want to give the casual site administrator control over), that one could argue it would make sense to have the option to include the text in the field setup (but I am still a rookie so maybe I have just not seen the principal reason why this would not be right).
  19. I am sure I have missed something REALLY basic here, but I still have to ask since I have not figured this out. If I am to insert an URL and I want to have a text display in its place, how is that accomplished using the URL-field. IE, how do I achieve this basic URL-function: <a href="http://www.xxyyzz.com">The text I want to show in place of the URL</a> ? I would have expected that to be a standard choice for the URL-field, but can't seem to find it so I must have missed something. Sorry for what I assume is a dumb question. Also, if I wanted to achieve this (url with alternate text) by just using tinymce, would that be possible? Would I need hanna code for that (and how would that be formulated in that case)?
  20. Ah, thanks so very much for that lightning fast reply! I was kind of hoping to avoid that (inline style), but if there is no way around it, I can probably live with it.
  21. Well, I guess this certainly would qualify as an embarrassing rookie-question, so at least I am in the right forum section. I am trying to call on a background-image from css (since this is the way the slider I am going to use is set up). I read this thread: http://processwire.com/talk/topic/3924-passing-image-field-url-to-css/ But I can't get it to work. One difference, I guess, is that I am calling on another page (hidden non template file site-setting page) for the image. Here is the working code I use in html to call on the image: <div id="logo"><a href="/xxxx/"><img src="<?php echo $pages->get("/site-settings/")->top_menu_logo_01->url; ?>"></a> What would be the syntax to set the same file as a background-image with css from a css-file? And do I have to do anything to the htaccess-file or such to enable php for that css-file? Any hint in the right direction on this would be much appreciated, since I don't want to resort to simply calling on the files from the /assets/files/ structure folder holding the image in question (works for now, but I feel it slightly defeat the purpose and workflow principle of using PW).
  22. OK, here are a few more points to consider Dave: The “clearfix” class comes and goes (there in initial TUT_article.php code under section “Template File” as a class for article_maintext; but no longer present in the resulting example under section “Adding the Fields”). It is part of the CCS so should be in the HTML I think, as it is needed for the layout to work as intended. Hence, it should be in the latter example of finished code as well to avoid confusion. When the fields are defined under “Creating the Fields” and referenced under “Creating the Article Template File”; there is just one image field, “article_images”. However, under section “Creating a Template”, that field (that has been setup to hold two images) has become the two fields “article_mainimage” and “article_secondimage” . You could go both ways I guess; I used the method with one field (that best corresponds to the tutorial text) and that works as described. Additionally (but less of a problem), the field “article_meta_keywords” appear in the image under the “Creating a Template” section (without having been defined or referenced before) instead of the actually defined field, “article_metadescription”. The keywords-part is also unnecessarily in the TUT_header.inc under the early “Header and Footer” section. As it is not used, it should probably be removed. Other than that, I ran through the whole thing and everything works! The one caveat is that I (for understanding and training) rewrote the php code references in the HTML myself using full php -syntax, so I can't vouch for there being no errors in the example code in that regard, but I followed along with the examples so I doubt it. All in all, not a bad way to take the first tentative steps into the world of php and cms in general - and ProcessWire in particular - for someone who is new to all this (like I am). Thanks again for your help! /ND
  23. Thanks team - amazingly quick with the solution - that did the trick (used the new TUTtopnav.inc code from the tutorial page)! Will report back after finishing the whole thing and let you know if I run into something else. About to have dinner with some friends here in the Stockholm Archipelago, so won't be until tomorrow. //ND
  24. Thanks for the prompt reply! Unfortunately, that left me with the same number of errors and the same result in output, only the message now is: Notice: Undefined variable: onlyViewable in C:\wamp\www\tendfor\wire\core\Page.php on line 807 As there are close to 12,000 views on that tutorial, I am kind of leaning towards either me having messed up, or me having the wrong version of some component. Kind of reluctant to start changing things in tons of files/places since it appears to have worked for everyone else.
  25. Hi, I just tried to run through the Basic Website Tutorial found here: http://wiki.processwire.com/index.php/Basic_Website_Tutorial When I got to the first testing under section “Testing the layout with the Home page”, I ran into some problems and the edited homepage did not render properly. Instead I get two error messages (with “# Time Memory Function”-tables with values in between). The error messages are (same in both places): Notice: Undefined variable: has_children in C:\wamp\www\XXXX\site\templates\TUT_topnav.inc on line 37 Line 37 in the TUT_topnav.inc is: if($has_children && $child !== $root) { I may have made some rookie error, of course, but before looking for that I wanted to check with you if there may be something that prevents my versions of some component from understanding the has_children variable? Don’t think I have done anything to define it in the code I put in/edited (but naturally that does not mean I’m not responsible for some newbie-dumbassery here). Any thoughts on this?
×
×
  • Create New...