The Va_custom_member Plugin has three main functions. First, it outputs the contents of one custom member data field—useful for including inside a weblog:entries tag, for instance. Or a forum template….
Second, It also allows for dynamically selecting categories based on the contents of member custom data.
Third, it will translate a category name into a category id. Useful for weblog entry tags.
To install: expand the download and drop the file in your system/plugin folder. It’s now available for use. You can read the instructions in your admin page/ utilities page and then the plugin manager.
Full instructions are in the plugin page once installed.
Here’s a summary of what this plugin does:
1) First usage
This plugin allows the contents of a member’s custom data field to be output. In a single tag, not a tag pair. This can be anywhere, in any template. That’s right, you can use this in a forum template, too. Ever wish you could output each poster’s custom field on their post? You can now. I’ve included explicit instructions on how to do that as well.
2)
This plugin allows you to dynamically select a category based on an equivalent custom member field. In other words, each member’s custom data can control what category your weblog entries field runs.
Consider the value of a category. It’s useful, for sure… but how can you tie a category to each member dynamically? With this function, you can, say, get a list of teams as a category. For instance, lets say you have a weblog that has team news for every NFL team. You can create a category, with each NFL team as a separate category. You can ALSO create the exact same list for a drop-down in the member profile field, as a custom member data field. Members can then select the team they are a fan of. With this function, you can then in your weblog entries tag dynamically assign the category you want displayed based on what team the member chose in their custom member field.
Example: Your site has news about professional American football. You’ve set up a category group with the names of each professional football team as it’s own category. You also set up a custom member field that is a drop down list; each line of the list is the same name as the category you’ve chosen. One member of your site is a fan of the football team Chicago Bears. They have selected the Bears in their member custom profile data. In your weblog, you have a category for each team name. You have a story for the Bears. With this function, when your member that’s a Bears fan visits this template with this weblog entries, this plugin will generate the category that corresponds to the Bears, based on the members custom data. The category is only the Bears, and the weblog tag only shows the Bears category. The next member is a New York Giants fan, and THEY have a category that corresponds to the New York Giants.
This opens up lots of possibilities, clearly.
3)
Third usage: Category name to category ID translation (thanks, Lisa, for the suggestion!)
Your weblog entries tags have to have a category ID to govern category displays, right? Which sucks if you are using category URL names, but on one page you want this to be different. This plugin also will translate your category name into a category ID for the weblog entries tag. It also means you can use any segment of your URL as the category name… or even if the category name feature is turned off, you can still use it sporadically with this plugin. Can be useful sometimes.
I hope this plugin is useful—I think it opens up a powerful set of possibilities for category and member data synchronization, plus forum customization. It’s my first plugin, so I hope I’ve done things right… and let me know, please, of the no doubt numerous errors there are in here. Thanks!
Edit: Added a EE 2 version. Completely untested for the moment, it will no doubt be updated.
And it’s updated some
I’m thinking this should be pretty simple and I’ve missed something, but the relationship field just isn’t accepting a conditional… bug?
Here is an example of what I’m trying to achive:
{if child_pages}
<div>
<ul>
{child_pages}
<li><a href="{path=">{child_pages:_title}</a></li>
{/child_pages}
</ul>
</div>
{/if}
Basically I am unable to remove the div and ul if there are no “child_pages” resulting in an un-semantic empty div and ul
Any suggestions?
Cheers
[edit]
Ignore the anchor in my example for some reason it keeps being changed from what I actually have in there when I try to edit it.
Can anyone explain to which tables in the ee schema correspond my channels and channels fields so I can just insert the drupal data accordingly under scripted control? In the abstract of course, I realize you don’t know the names of my tables nor in theory shoudl you have to. I presume EE generates tables, columns, etc following some pattern like Drupal did. e.g. drupal had a content_type_pressrelease table for their analog to a channel, and then had columns in that table that corresponded to the custom fields I added.
Thanks.
]]>Thanks
R
I’ve created my own Events module that collects information about attendees to multiple events.
I need to output some documents in the admin area, some pdf’s for receipts and csv files for a list of attendees.
My goto code for this type of thing would normally involve creating a page with no admin chrome, and then forcing a download using either dompdf for pdf’s, or manipulating php headers for csv.
Unfortunately, I cannot find out how to specify an admin page, that has no admin template. How do I output a raw page in the admin area?
Thanks,
James
]]>I saw an addon by Booyant / The Outfit called Better Pages (http://fromtheoutfit.com/better-pages) that seems to do this, but since I don’t have experience with either this or using the pages module, I wasn’t sure if I was misunderstanding.
Anyone ever do something like this before?
Thank you in advance for suggestions and help.
]]>includes/site_css
I do that via:
<link rel="stylesheet" type="text/css" href="{stylesheet='includes/site_css'}" />
The code that ends up spitting out when viewing the page source is:
<link rel="stylesheet" type="text/css" href="http://www.codewhore.com/index.php?css=includes/site_css.v.1369319982" />
Which is a valid URL to my CSS template. The only problem is, the CSS doesn’t seem to be included, none of the custom styles defined therein are available.
If I take the contents of that CSS template, save it out to a file, and included it via:
<link rel="stylesheet" type="text/css" href="/site/css/sop.css" />
...then it all works. However, I’d like to have the site CSS kept in EE if at all possible. This seems so basic, that I must be missing something simple. Help?
]]>There is only one problem is that these activities can span across multiple dates and the Channel Calendar tag only shows the entry on the date of its Entry Date, while I want them to appear on all the days between the Entry Date and Expiration Date. Is there a way to accomplish this?
I already tried using an invalid channel in the calendar tag and retrieving the activities with a Channel Entries (and a bit of help from Stash), but here I encountered the same problem. (Activities are only shown on the first date)
{exp:channel:calendar channel="none"}
{exp:stash:calendar_date}{date format="%Y-%m"}{/exp:stash:calendar_date}
{calendar_rows}
{if not_entries}
{day_number} <br/>
{exp:channel:entries channel="activity" dynamic="no" parse="inward"
start_on="{exp:stash:calendar_date}-{day_number} 0:00"
stop_before="{exp:stash:calendar_date}-{day_number} 23:59"
show_expired="yes" show_future_entries="yes"}
{title} <br/>
{/exp:channel:entries}
<hr/>
{/if}
{/calendar_rows}
{/exp:channel:calendar}
I left out most of the code that wasn’t necessary for this example and used very simple mark-up instead
TDLR: How to make a calendar which displays all active entries on each date
]]>I’m struggling a bit trying to create a list of entries with relationships.
My client is a home developer and they would like a list of their communities that are separated by the quadrant they exist in. For example:
North West
Community Name
Community Name
South
Community Name
West
Community Name
I’m not having any issues creating list. The problem I’m having is: when there isn’t a community related to a quadrant I don’t want the Quadrant title to show and I’m finding it difficult to find a solution.
Here is a sample of my code:
{exp:channel:entries channel="quadrants" site="home"}
{if parents:no_results}
<h2>{quadrant_title}</h2>
{/if}
{parents field="quadrant"}
<a href="{path=communities/details/{parents:url_title}}">{parents:community_title}</a><br>
{/parents}
{/exp:channel:entries}
Right now the conditional is showing all Quadrant titles that currently don’t have a community attached and I would like it to do the opposite.
I realize this is probably pretty simple but I’ve been banging my head against it for too long now. Any help would be greatly appreciated.
Thanks All!
]]>