Wordpress - Display Content Conditionally - wordpress

I am fairly new to Wordpress. I am writing a real estate site, and I want to have a Service Area page that displays the Counties that we serve in various states. So what I want to happen is to have a dropdown list where a user can select a state, and based on the state that they select, a text area will display that counties that we service in that state.
So basically, I want to store text content in the form of counties that will be displayed based on the conditions of a dropdown list.
I have no idea where to start. Is there a plugin that works for this kind of situation such as a form plugin that can store content, or am I going to have to write custom PHP/Javascript to make something like this happen. I am asking because this seems like a common scenario on websites, I just don't know where to look.
Thanks for any suggestions that you may have!!

So what I ended up doing was creating a select box in html that when a change happened on the list, a javascript function was called that changed the visibility of a text area and also set the value of its content to display all the counties that I needed. Ended up being much more simple than I expected. No PHP functions and short code necessary.

Related

trouble with creating a breadcrumb in asp classic

I need advice on how to do breadcrumbs in asp classic
I have a company detail page - the thing is it could have been gotten to by a number of ways - through a area or through a list of categories and then companies
I want to show the breadcrumb that this user came to it
(and the same page can be gotten to in many ways)
I tried to build a session variable but if a user clicks the back key then it messed it up
any ideas?
When you design your site you need to work out, in your own mind (best to use a pencil and paper), just how the site links together and which pages can be considered to be related. I know this sounds pretty grey, but this is more a design principal than set in stone.
Word is a good tool to work this out. Flick into Outline View and use this to build up the structure. The arrows on the ribbon at the top left allow you to indent and outdent your structure, and the markers at the beginning of the line allow you to drag and drop sections from one place to another.
Once you're happy about the structure you can update your pages to contain the stepped breadcrumb. Unless you have heavily automated pages that change their structure vastly, or a site that is very fluid (changing it's structure frequently), I would simply hard code the breadcrumb in using an unordered list (<ul>).
It gets more complicated for Classic ASP if you want to be able to automate the breadcrumb. Firstly you'd need to decide what type of automation you want to use; for instance XML, like the .NET version, or a global.asa string/array version, or something that's read from your database... The list goes on.
If you still find it difficult to get around the user's landing page train of thought, try using the search page on a site like the NHS Data Dictionary, or even try navigating using the links on the left. The breadcrumb for this site is in the top banner - watch what happens when you switch between different links.
Hope this helps, but remember there's no right or wrong way to code up your links, it simply depends on the application or site you're creating.

Customizing Search in Orchard

Is there any option to completely control a Search module with a Summary view? I am struggling to get there. I have the following settings so far:
In admin I created an Index called PublicSearch with a number of fields.
I am getting a search result which is a mixture of two content parts - Question and Expert
I have a Part view to be used in search result for Experts called ExpertSummary.cshtml. The view only contains the following elements now:
#model dynamic
<p>Expert Summary</p>
When the search result is coming I only expect the "Expert Summary" to be visible in Expert region of the Search but I am getting an additional "body" section (truncated to X characters). It seems to me because "body" is selected as a field when I created the Index it is coming up.
Each Expert record has an image of expert which is coming up in the search result and When I take out <Place Fields_MediaPicker="Content:1" /> from Placement.info it disappears, which is fine.
But I want this summary to be completely controllable in ExpertSummary.cshtml - like a two column layout where the left col will hold the expert image and the right one will hold a brief description along with some other info - but everything would be in the View - should not come from Orchard search module as defaults.
In short I want Orchard's Index and Search modules to be functional and working like it is now but the layout and information I want to control completely using custom HTML in Parts/ExpertSummary.cshtml view.
Is this at all possible? If yes, how?
Please suggest. I am completely lost my way in Orchard framework!
I'm not completely sure I understand your question... Orchards search returns a Summary view by default. So you need to control the layout of your summary. Use shape tracing to create a new alternate to change the layout of the summary view. So ExpertSummary won't control the entire layout, it will just control the Expert part. Then use placement to decide what to display. http://docs.orchardproject.net/Documentation/Understanding-placement-info
Also, tagging questions with "orchardcms" will be more useful than "orchardcms-1.7".

WordPress - add Database driven tables

I'm just trying to move one of my old php sites to wordpress. As part of the site I have 'top tables' e.g. top 10 cars, listing their features etc. At the moment that all comes from a database and the HTML is generated from the data.
So if a car soon gets a hybrid engine I just check that in the database and my web site table updates to reflect that.
This all works fine. I just don't know where to start when trying to implement something like this in wordpress. I want to keep the WP header, footer, nav... and put my table in to the content area.
Someone recommended simply copying the current generated HTML in to a new post and editing the HTML when anything changes, this sounds like a quick solution but there must be a better way of doing this.
Ideally I would want to keep my current data input pages (and separate database) for all of this 'table data' and present the out put as a post.
If anyone can point me in the right direction (key words I should search for, a guide) that would be great.
Depending on your usecase, you'll usually want to use a static page template:
http://codex.wordpress.org/Page_Templates
Or shortcodes:
http://codex.wordpress.org/Shortcode_API

drupal multiple interest of user

hi i want to refresh user page with different data but with same template (user-profile.tpl.php) by simply clicking tabs. Can any one suggest the best way to do that ?.
for ex:
tab1:sports , tab2: music tab3: literature
by clicking tabs the template is same but the data is going to refreshed.
Note: Look like profile categories but not the same. all details are from user table
I think the simplest way, which isn't exactly what you asked for, would be to using jQuery tabs or something similar to create the tabs effect. In other words get all the data but use CSS and JavaScript to handle which data should be displayed.
I don't think there is an easy way to split up the content of the user profile into tabs with pure html and Drupal.

Listing Items and Displaying Data Inline

I use asp.net 3.5 and have also begun looking at 3.5 sp1
I like the clean urls that mvc tends to have but use asp.net webforms for my primary development. I normally use a url rewriter in order to accomplish this type stuff. When I say clean urls I mean like /products to get a list of products and /products/Product_One to look at the info about product called Product_One. I've used this on sites where the listing is on one page and when you pick the item it goes to a different page that shows the info about the item selected.
but
I also like the way that the update panel works and changing stuff on screen with out flashing the screen. When I do this I tend to have a list on the left with the different items that are selectable and then have on the left the data about the selected item, then I use an update panel so that when the item on the left is selected it's data shows up on the left without flashing.
I need opinions on what you all think of the two different methods of displaying a list and seeing the item that is selected's data.
1) Which is better in your opinion?
2) What do you all do to display a list and show the data on one of the items?
3) Is there another way of doing this?
4) Is it possible to combine the update panel method and the nice urls? (i.e. change the url to match the url that would get you to the current displayed data even though the update panel was used, and add to the history the new clean url for the current page)
What you are referring to is AJAX URL history management but you will not be able to modify the URL besides the "#" anchor.
At least not without reloading the page.

Resources