I can’t get any results when a field has a / in it. I’m not really up on REGEX, but a quick search shows \ as a reserved character, but not /, so I don’t think it has to do with that?
So for example if I search for “Advertising/Marketing/Public Relations” I get no results (when there are results).
Help?
Well that’s what I was thinking, except it doesn’t work even when I’ve escaped the slash. Searching for:
Agriculture\/Forestry\/Fishing
Returns no results - even though there’s an entry that has that field value. Are regular expressions even working? They didn’t work when searching for /.+/ and that lead to your solution of using > (thanks for that again).
Let me clear one thing up: the extension inserts straight SQL, and doesn’t use any REGEX engine. So there shouldn’t be a problem with the / character. My guess as to the problem is that it’s converting ‘/’ into a html entity. Can you post a link to a page where the query isn’t working?
To follow up: Mark spent a lot of time working with me and figured out what the problem was. He was correct in what he guessed above - the templating engine was turning the / in the ascii equivilent, and that would return no results since it was then searching for something entirely different.
So searching for an entry with / wouldn’t work - but it does now (or will when I assume he uploads a new version of the extension).
A big thanks to Mark for all his work. 😊
I’m wondering if there was ever a conclusion on the functionality of this extension. I see that it is several versions updated since this original set of posts. I have downloaded and tried to use this (following all of the issues in this thread) but it doesn’t work. I at least can’t determine if it is not functioning or if my usage is buggered up. It would help if anyone could provide just a bit more documentation as to the syntax required? This is just the thing I was waiting for after trying to do this with a conditional tag testing a segment variable. Apparently you can’t test against dynamic data this way.
If anyone has this extension working, I’d love to see a working example with a code snippet.
thanks
troyb
Hey Troyb I agree the documentation on it is a bit difficult, but the extension is indeed working. Make sure you made the mecessary changed to the file mentioned in this thread and in the source of the extension. Also make sure the extension is enabled in the admin section of your control panel. Finally tell us what it is your are trying to do, and what doesn’t work means in this case, and someone will be much more able to help you.
Hi UltraBob, thanks for the suggestions. Yes I have made the adjustments (successfully) to the mod.weblog.php file as noted in the top of the extension. Let me try to fill you in on the details:
I am creating a single template that will dynamically determine which artist has been selected and appropriately displays information and thumbnail images for said artist. The current example can be seen here:
http://getthisgallery.com/index.php/artists/nate_moore/
Currently, I am having to copy a base template and hard-code the name of the artist into an {exp:weblog:entries} tag. This of course is made easier with Mark Huot’s cool ext.custom_fields_in_ee_tags.php extension. However, it’s not very scaleable.
//at top of template
{assign_variable:my_name="{segment_3}"}
//in body of template - tag is the custom field name
<div id="thumbs">
<ul>
{exp:weblog:entries weblog="inventory" tag="nate_moore" rdf="off"}
<li><a href="http://{work_image}">" title="{title}"]{work_thumb}</a></li>
{/exp:weblog:entries}
</ul>
</div><!-- end thumbs -->
What I’d like to do is just use the segment variable, but it won’t work. Previously, I was attempting to do this with a nested {if} block inside an {exp:weblog:entries} tag . I had it working if I hard-coded the name into the {if}, but as I found out, you cannot use dynamic variables (including segment variables) in an {if} condition test.
//at top of template
{assign_variable:my_name="{segment_2}"}
//in body of template
<div id="thumbs">
<ul>
{exp:weblog:entries weblog="inventory" rdf="off"}
{if work_artist == "Nate Moore"}
<li><a href="http://{work_image}">" title="{title}"]{work_thumb}</a></li>
{/if}
{/exp:weblog:entries}
</ul>
</div><!-- end thumbs -->
So, as you may have determined, I am trying to pass the dynamic bit to the template via a segment variable. I want to do this entire project with as much EE mojo out of the box. This is my first EE project and I am trying to use this project to learn EE.
thanks for any help y’all can provide.
Hey, I’ll look at this further tomorrow (is late) but one thing I do when I want to dynamically insert segment vars or other vars into an exp:weblog tag is to embed a template and pass variable to the embedded template. you can use those variables in the embedded template
e.g.
{embed="shared/artist" artist="{segment_3}"}
then in shared/artist
{exp:weblog:entries url_title="{artist}"}
Sorry if I’m misunderstanding what you are trying to do. Like I said it is late 😉
Ok, here goes everything!
first, thanks UltraBob for the tip on embedding templates. I will definitely be using these more! Kind of like SSI’s is the way I see them. I looked them up in the docs to make sure that I got the syntax correct. Unfortunately, I’ve tried the following with no luck.
//in the main template
<div id="thumbs">
{embed="inventory/index" artist="{segment_3}"}
</div><!-- end thumbs -->
//in the newly created sub-template
<ul>
{exp:weblog:entries weblog="inventory" artist_tag="{embed:artist}" rdf="off"}
<li><a href="http://{work_image}">" title="{title}"]{work_thumb}</a></li>
{/exp:weblog:entries}
</ul>
But of course this works!
//in the main template
<div id="thumbs">
{embed="inventory/index" artist="mike_brodie"}
</div><!-- end thumbs -->
//in the newly created sub-template
<ul>
{exp:weblog:entries weblog="inventory" artist_tag="{embed:artist}" rdf="off"}
<li><a href="http://{work_image}">" title="{title}"]{work_thumb}</a></li>
{/exp:weblog:entries}
</ul>
This led me to think that maybe the way that embedded templates work (passing dynamic variables), it might let me insert dynamic info into an {if} conditional. It seems that embedded templates have a special parse order. However, due to the weak parse/render order of operations with {if} blocks, I get no luv. Not even with hard-coding the name into the embed tag.
//in the sub-template
<ul>
{exp:weblog:entries weblog="inventory" rdf="off"}
{if work_artist == "{embed:artist}"}
<li><a href="http://{work_image}">" title="{title}"]{work_thumb}</a></li>
{/if}
{/exp:weblog:entries}
</ul>
ok, so screw the embedded templates for now. Let’s go back to basics.
//in the original main tepmplate
<div id="thumbs">
<?php
$uri = $_SERVER['REQUEST_URI'];
$test = explode("/", $uri);
$seg3 = $test[4];
echo $seg3;
?>
<ul>
{exp:weblog:entries weblog="inventory" artist_tag="<php? echo $seg3; ?>" rdf="off"}
<li><a href="http://{work_image}">" title="{title}"]{work_thumb}</a></li>
{/exp:weblog:entries}
</ul>
</div><!-- end thumbs -->
It doesn’t work.Ok, I am officially stupid, in public no less. mommy…
Thanks for the reply Mark. I have triple checked the php parsing stage by selecting the template group and then going into preferences. I too thought about this and rechecked. The original echo after the explode, renders, but at what stage I can’t tell. I wish I could “trace” or “alert” values during execution. Finally, your above tip doesn’t fly either. I updated from Core recently. Could I have mangled something? Is there a test that I can conduct to test how plain PHP is working in my templates. I suppose I could use the photo module if it is embeddable? I’ve hit a brick wall and I can’t believe that something so simple is so difficult to accomplish. I’m sure many others have create a series of dynamically generated thumbnails in EE, but how?
Here is the complete template, maybe there’s something else in it which is breaking this functionality?
{assign_variable:my_template_group="site"}
{assign_variable:my_name="{segment_3}"}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>GET THIS! GALLERY : {exp:weblog:entries weblog="artists" url_title="{my_name}" rdf="off" limit="1"}{title}{/exp:weblog:entries}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en-us" />
<meta name="author" content="Troy Bennett" />
<meta name="robots" content="all" />
<meta name="Description" content="Get This! Gallery is a live/work space located in the historic Castleberry Hill neighborhood in downtown Atlanta, Ga. The gallery's main focus is to act as a launch pad for artists ready to make their mark on the contemporary art world. " />
<meta name="Keywords" content="art gallery, fine art, painting, woodcuts, photography, silkscreen, stencil, exhibitions, Lloyd Benjamin, Nate Moore, Drew Conrad, Jill Storthz" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<link rel='stylesheet' type='text/css' media='all' href='{stylesheet={my_template_group}/test_css}' />
</script>
</script>
</script>
</script>
</head>
<body id="artist" class="artIndex">
<div id="main">
<div id="header"> <a href="http://getthisgallery.com" title="click to get to the homepage">/pix/logo.png</a>
<div id="top">
<div id="logoFix"></div>
<div id="address">322 Peters St. Atlanta, GA. (Castleberry Hill Arts District)
<span class="bold"> Hours:</span> 12 to 5 p.m. (Thurs.- Sat.) or by appointment. | <span class="bold">Phone:</span> 678.596.4451
</div> <!-- end address -->
</div> <!-- end top -->
</div> <!-- end header -->
{exp:weblog:entries weblog="nav" rdf="off" limit="1"}
{nav}
{/exp:weblog:entries} <!-- end nav -->
<div id="content">
{exp:weblog:entries weblog="artists" url_title="{my_name}" rdf="off" limit="1"}
<h1>{name}</h1>
<div id="ArtistInfo">
{intro_blurb}
<a href="http://{artist_url}">artist's info >></a>
{/exp:weblog:entries}
<div id="thumbs">
<ul>
{exp:weblog:entries weblog="inventory" artist_tag="<?php global $IN; echo @$IN->SEGS[3] ?>" rdf="off"}
<li><a href="http://{work_image}">" title="{title}"]{work_thumb}</a></li>
{/exp:weblog:entries}
</ul>
</div><!-- end thumbs -->
</div> <!-- end artist info -->
</div> <!-- end content-->
<div id="artwork">
{exp:weblog:entries weblog="artists" url_title="{my_name}" rdf="off" limit="1"}
{show_card}
{extra_text}
{/exp:weblog:entries}
</div><!-- end artwork -->
<br class="clear" >
</div><!-- end main-->
</body>
</html>
The way it should look and function can be seen here: http://getthisgallery.com/index.php/artists/nate_moore/ The main difference is invisible, but rather than be hard-coded to only 8 thumbnails, it would grab all of the images by that artist in the inventory “weblog”.
My new non-hard-coded template is here: http://getthisgallery.com/index.php/artists/artist_details/nate_moore/ You’ll notice that the thumbnails don’t show; but what’s REALLY crazy is that the nav dissapears too! It’s like the thumbnail issue kills EE and it stops processing the template and spits what’s left out. However, the nav is before it in the code. Wouldn’t that make it have to render before the thumnails?
If I need to move this to another thread please let me know. At any rate, Mark your extention rocks. Too bad I can’t (maybe others can) feed it dynamic data.
I’ve always found Mark’s extensions to be straight forward and easy to implement and use… except this one.
I have tried numerous times to get this extension working on different projects for ages now and it never has ever worked. Every time I read through all the posts, add the custom hooks, enable to extensions…. and nada:(
In the end I always use a query to get what I want.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.