How Can I Use Shadowbox to Extract Text Only from Webpage? - text

I have an article set up in Joomla that displays Terms and Conditions for the site users. I would like this to show up in a shadowbox when a user clicks a link. Here is the current anchor text example:
Terms and Conditions
This works out great for displaying the entire web page, but what I would like to do is just display the article text on the page (plain with a white background). Is this in someway possible with shadowbox? If so, how?

If I'm understanding you correctly - you want to suppress the modules and other periphery from your 'page' when it is loaded in the shadowbox.
Add ?tmpl=component to the url of your link.

You can do this with a div element and css shadow effect.
How to show/hide div is explained here:
http://www.randomsnippets.com/2008/02/12/how-to-hide-and-show-your-div/
How you can add shadow is explained here:
http://placenamehere.com/article/384/css3boxshadowininternetexplorerblurshadow/

I believe there are some components to do this - but you may have to get creative to do it without pulling the whole page with an a href tag.
In the database there's a particular area that holds that specifically and you could write a little query to just pull that information specifically and put it in the shadowbox, but what that query would look like I'm not sure.

Related

Orchard - access a content type through different URLs so they use different views

I'm trying to create a CSS documentation library in Orchard. I want to save a description, CSS snippet and HTML snippet against each content type. The first view would show the description and CSS and HTML code written out. The second view would show a preview of what the CSS and HTML look like rendered.
cssdocumentation.com/content/item1
cssdocumentation.com/content/item1/live-preview
I've created the content type and the first view. But I'm not sure how to create the second view. I can see if I can create the alternative URL I can use the Url Alternates module to create an overriding .cshtml
To create an alternative URL I've looked at the autoroute module but this only allows you to adapt a single URL (unless I'm missing something?) and I've looked at Alias UI but this forces me to manually create an alternative URL everytime I create a content item.
Is this possible in Orchard without writting too much C#? (I'm a frontend developer so I only dabble in the behind the scenes stuff)
Thanks for any help
Best solution is to do this within your own module. But as a secondary option instead of having a second page, combine this content with your first page and hide it with CSS. When the user clicks a button to navigate to the next step render the CSS/HTML result on the same page. You can do this in many ways, here are a few ideas:
Render the CSS/HTML result out straight away on the same page but hide it. Show it when the user clicks a button
using jQuery to render the result on the client side. More dynamic if you allow editing of the HTML and CSS.
Redirecting the user to the same page with specific url parameters which you can pick up in your alternate to modify the output.

Orchard CMS create theme view for my content type

I am using orchard cms with the bootstrap theme.
I have created a content type: House
it contains FIELDS
image (media picker field)
Property Type (taxonomy field)
Location (taxonomy field)
It has PARTS
common
body
publish later
Title
Autoroute
I want queries of houses and be able to choose the view/ layout for them
e.g. layout called HouseList (for sidebars mainly) which will render: title, image and link to house, possible location and type but with out the links as defaulted. And then a fullDetails layout and a image only layout (so i can show a jquery image reel a widget say in a quadzone) How can i do all this please, i have tried in view Content-House.cshtml etc but i cant access the details model.content to choose what to display.
Im sure when i get the idea of how to do 1 i should be able to sort the rest. I have read documentation etc but there are so many different ways, ie placement file, change the parts, contents, create classes to handle display etc. sureley i am missing something simple like create a view for each list i want eg. houue-list, house-details, house-imageONly and then manipulate content.
Please help i have been trying different things for getting this site running for weeks and not getting very far. Examples would be fantastic but i have searched google for hours and found similar but nothing with enough details for a meer beginer.
Thanks
The standard way of doing that is placement to move things around and alternate templates for the different parts and fields. You can specialize placement and alternates with the display type, which is Summary when rendering in a list such as what a projection returns, and Detail for the detail view. More info on placement can be found here: http://docs.orchardproject.net/Documentation/Understanding-placement-info and on alternates here: http://docs.orchardproject.net/Documentation/Alternates
Now if you prefer to completely take over the rendering and do without placement, here are a few posts that may help:
http://weblogs.asp.net/bleroy/archive/2011/07/31/so-you-don-t-want-to-use-placement-info.aspx
http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx

Top part of webpage stays the same

I want to create my webpage so that a part at the top that says "Welcome!" and a "main part" below that. When a user clicks on a link in the main part (say, it links to www.example.com), the main part should change to the content of www.example.com, but the top part should remain the same. How can I achieve that?
In ye olde days, this was done using frames, but for many reasons, they are going out of use. Try taking a look at iframes.
I believe you're looking for the
<frameset>
tag: http://www.w3schools.com/tags/tag_frameset.asp
The <frameset> tag is not supported in HTML5. Although <iframe> works, it will impact your page's searchability (SEO), and setting up the page to scroll properly will be a hassle because the "top" part of the page will be like a page of itself.
Instead of using (i)frames, if you have PHP enabled on the server, you should store the "top" of your webpage as a separate file like "top.php", and in every page, include that with
include_once("top.php")

Orchard CMS: Is it possible to add BeforeContent, Content, and AfterContent content when editing a content page?

Is it possible when editing a content page to have a text box for Content, BeforeContent, and AfterContent?
I would like to break up my articles into sections such as introduction, core, and summary so that each part gets styled differently in the Layout.cshtml. The only way I can think to do this is to create a layer for each content page then add html widgets for the BeforeContent and AfterContent zones that I would put my introduction and summary in. This seems like alot of extra work.
Sure, add fields and set-up placement for them. Widgets will work too but it will be more painful to maintain. If not almost impossible.

Web accessibility and h1-h6 headings - must all content be under these tags?

At the top of many pages in our web application we have error messages and notifications, 'Save' and other buttons, and then our h1 tag with the content title. When making a web application accessible, is it ever acceptable to have content above the top-level structure tag like we do here?
As a screen reader user I don't like content above the main heading. Normally I navigate by headings so would miss the error message. A better solution is to output an h1 heading above the error message, then leave the rest of your headings in tact giving you two h1 headings.
Yes (you can put stuff above them). The H simply means Heading. It's a question of what the heading relates to I guess.
My only caveat is, H2 shouldn't really be above H1, and H3 Shouldn't be above H2. But I don't think it's an actual rule.Websites have menus, warning, notifications. It's acceptable to put them above the rest of your content. I don't see how it would affect accessibility as long as your content is ordered logically. Look at the page CSS turned off. Does it look logical? That's the most important part of accessibility.
Although some people do go that extra mile and have the menu as the last item in the markup and use CSS to bring it back to the top. Personally, I find that solution counter productive. The menu is still important, it belongs at the top of the page.
Yes, just consider it is in that order that the user will get the information. So, if you just did an operation it sounds like a good idea to get any message related to it as the first thing. If it is a notification that appears on any page unrelated to what you are doing, I wouldn't put it above, as it might be a little weird.
Also you can use a text browser that doesn't use styles, it should look like a document with appropriate headers.
Heading tags are used to indicate the hierarchy of the content below it. You should only have one h1 tag and it should be the first content to appear on your page (this is usually the name of the site). Also, you shouldn't skip heading tags when drilling down through different tiers of content.
In your case, you can still use CSS to position items above the h1 tag as long as it is in the correct order in the html.
I assume the elements above the heading are used by JavaScript. In that case, it's preferable if they are created by JavaScript, not included in the source of the page.
To return to your original question, it is probably best that they be at the foot of the page. However, if they are hidden using the CSS "display: none;" or "visibility: hidden;" properties then they will not be seen by most (perhaps all?) screenreaders or by many other assistive technologies, and so should not be an issue. I've written a fairly detailed explanation of why accessibility technology ignores such elements.
Of course if somebody disables CSS things are going to look pretty messy. If there is content on the page that can be used even when CSS and/or JavaScript are disabled, then putting those elements at the bottom of the page will at least make things less cluttered.

Resources