Jump to content

derelektrischemoench

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by derelektrischemoench

  1. Hi guys, I've got a little problem here which I can't completely get my head wrapped around. So I've got a site which has links to several picture galleries and I want to set one image as a thumbnail to enter the gallery, which so far, isn't that big of a problem. Then, I'd like to place a caption for the gallery inside that div on top of the image to make it animatable. Now my first approach would have been to use the css "background-image" property for the background and then use regular markup for the captions and animate these. But unfortunately I can't use the api with css. I've tried inline styles but that didn't work, then the image covered the caption. Basically I'm looking for something like this: <div class="thumbnail"> <a href="..."> (Link to my gallery) <div class="flex-item6" style="background-image: (<?php echo $image=$page->images->get ("chrysanthemum_thumbnail.png")->url; ?>)"> <span class="overlay">stuff</span> </a> </div> I just sketched this up, I'm on the road and can't access my original code, but I hope you get the idea. When I tried this earlier, either the markup wasn't displayed or it showed under the image when I used position:relative in my css. So where did I mess up probably somwhere with all the brackets and stuff when calling the api...? And is there a solution to this without using inline-style? /edit: I tried implementing it via css, which worked but that ultimately means that I would have to store my thumbnails separately in some folder and can't access the via the backend Thx Greetz derelektrischemoench
  2. Thx. The critical link I was missing was the whole image- field thing. I read tons of other stuff while googling for a solution and all of them had the echo $page->images - code but only from the code I wondered how PW could find the path to those images. Of course by storing it in an image field on the site. Quite obvious, actually. Thanks again.
  3. Of course. That worked. Thank you so much, this saved me a whole lot of trouble. Greetings from Baden- Württemberg ;-)
  4. Hm okay. Like I said, I'm new to this whole thing @pwired: I uploaded the images I wanted to the page (basically I added an image field to the template and the dragged and dropped them in there). Then I did the <img src="<?php echo $image = $page->images->get("name=filename.png"); ?>"/> Unfortunately that didn't work. Where's my mistake? Thanks for pointing the thing with the image field out, though, somehow my brain seems to be clogged, I didn't even remotely consider this option :/ Greetz DeM
  5. This is what I need. I just need a link to an image that doesn't change its filename but probably its directory.Unfortunately, though, the above example doesn't work for me.
  6. Hi guys, I'm trying to call an image inside an <img>- Tag, to make the directory structure more versatile, making it unnecessary to always type the whole path to the image I'm relatively new to web development, php, Processwire and the likes so this might occur like a stupid question to you. But please, bear with me, I've spent the last hour on this and I'm starting to feel stupid. Currently I have a few images embedded like so: <img src="direct/path/to/image.png"></img> But this sucks. is there a way that I can achieve a link to a certain image, respectively its filename, id or similar like e.g. so:? <img src= <?echo "image.png" ?>> or instead of a filename an ID or something similar, so that if I change the path of the image resource, they still get embedded. The solution to this is probably very simple, but I'm fairly new to php and Processwire and I couldn't figure it out. Help would be much appreciated. Best regards DeM
  7. Good afternoon, fellas, sooo I installed the blog module, and it works totally fine, kicking ass and everything, I love it. I'm currently working on a site which is not a blog, but has a blog- subpage, which I got rolling. But what happens, or more like what do I do, if I want a second Subpage on my site which uses the blog - functionality? is there a way to achieve this? consider the following page tree: Home stuff -> regular content stuff2-> Blog 1 stuff3 -> Blog 2 .. and so on. so basically I would want two subpages on my site on which I would be able to publish blog posts independent from each other, which (in my opinion) would mean that I could tell the blog module at a certain point to publish a post on either one of these two pages. Help would be much appreciated. Best regards, DeM /edit: so I kinda had an idea for an approach to a solution to my problem, my thought was, that I could use two templates, which output blog posts by category, so basically I'm looking for a function which outputs posts with category "blog1" on the first page and in a second php script, one that outputs posts with category "blog2" on a separate page. so far though, I couldn't find anything about that in the documentation, I only found output filtered by post author, does the same apply to post category? //edit 2: I managed to do that, just had to change a few lines in one of the php files. Finally, everything works, and I have to admit, I am totally impressed. this module kicks ass in any way imaginable. Thank you so much Kongondo. Greetings from Germany, DeM
  8. Hi Kongondo, so I reviewed my css (it's not that much so far), and I didn't find the use of the class "active" or anything comparable that would mess this stuff up further down the cascade, but I guess that's not the problem here. If I inspect my code and select a child item from my menu, the script simply doesn't apply the class "active", meaning the output markup stays completely the same. This is the code that generates my menu so far: <?php $options = array( 'wrapper_list_type' => 'ul',//ul, ol, nav, div, etc. 'list_type' => 'li',//li, a, span, etc. 'menu_css_id' => 'nav',//a CSS ID for the menu 'menu_css_class' => 'drop',//a CSS Class for the menu 'submenu_css_class' => 'submenu',//CSS Class for sub-menus 'has_children_class' => 'menu_child',//CSS Class for any menu item that has children 'first_class'=>'menu_top',//CSS Class for the first item in 'last_class' => 'menu_bottom', 'current_class' => 'active', 'current_class_level' => 2,//how high up the ancestral tree to apply 'current_class' 'default_title' => 0,//0=show saved titles;1=show actual/current titles 'include_children' => 4,//show 'natural' MB non-native descendant items as part of navigation 'm_max_level' => 2,//how deep to fetch 'include_children' ); $menu = $modules->get("MarkupMenuBuilder"); //load the module echo $menu->render('nav', $options); ?> so from my understanding the line 'current_class' => 'active' should assign the class "active" to the currently selected/active menu item, which would then enable me to adress this class via css, correct? Unfortunately this class assignment doesn't take place Perhaps I got some of the code generating the menu wrong, I'm relatively new to programming and have yet to overcome sucking at it, so feel free to correct me Thx so far derelektrischemoench //edit: Solved it myself. The problem was that I didn't set my "home" page as the parent of the menu tree, I assumed current_class_level somehow magically recognized the site tree and applied .active to parent items. Which, of course, it didn't. Thx nevertheless, sry for wasting time by being stupid
  9. Hi guys, I have a similar / the same problem as Torsten. But somehow, if I set "current_class_level" to 2, it doesn't seem to apply, for reasons I don't understand. My site structure looks something like this Home about used stuff products Tv Home Cinema Speakers Streaming solutions etc. If I navigate to products, the script automatically assigns the css-class "active" to the selected menu item, which changes the color of the menu item in the navbar. If I navigate to one of the children of "products" (TV,Home cinema etc.) though, my top menu item "products" loses its css class. I thought I could prevent "products" from losing its css- class when browsing children of "products" by increasing the value of 'current_class_level' to something greater than 1. But if I do so, it doesn't change anything, my menu item "products" still loses its class when I navigate to one of its children. I hope my description was understandable, and I hope even more that someone has a solution for my problem. Best regards, derelektrischemoench
×
×
  • Create New...