I have a single article and I want to display a portion of the content to the Registered user group only and the other portion to a Custom user group only.
I'm sure I read an article sometimes int he past year about doing this without a plugin (Though I may be mis-remembering the article)
Is this possible without an extension using something along these lines?
{content group=registered}
You can create a category (with limited access) say Registered. Create another category with restricted access say Paid_Access.
Now for every article create two articles - one in Registered category containing only Intro text and another full article in Paid_Access category.
Create Access Group and Access levels with same name
The hierarchy of the access levels will be as follows:
Public
Registered
Paid_Access
Set the Registered category to access level Registered. Set the Paid_Access category to access level Paid_Access
By default, on Joomla registration every user will be in Registered access level and will be able to only view article intro.
When user make some payment, move the user to Paid_Access access level. Users in this level can view the complete article.
Creating two articles for every new article may be cumbersome, to reduce this pain, you can create a custom form using ChronoForms. This form should have two text areas for the article - one would be for Intro text and another full article (without Intro text). The form while saving, will itself create two articles - one in Registered and another in Paid_Access. Thus your pain of creating two articles will be gone!
It is not possible without a plugin.
Reason : When Joomla is preparing content then there must be a function(code snipet) that detects the Text enclosed in {content} tags and decide what to do with this text and accordingly edits the content.
I have developed a Content Plugin, This will helps you https://github.com/jitendra-khatri/jcontenthider to setup your scenario.
You could do this with CSS if your template adds the access level as a class on the body or html (mine do). Though anyone with firebug or a code inspector could unhide content if they thought to look at the source.
<body class="registered">
// other code up to article content
<div id="articleContent">
// this is now in your article
<div class="hidefrompaid">
// content for registered users
</div>
<div class="hidefromregistered">
// content for paid users
</div>
</div>
...
Then your css would be:
body.registered .hidefromregistered {
display:none;
}
body.paid .hidefrompaid {
display:none;
}
Or if you really want to not show it you could use jQuery to delete the text the user should not see using those same css classed wrappers around the text.
jQuery('body.registered').find('.hidefromregistered').remove();
jQuery('body.paid').find('.hidefrompaid').remove();
I ended up using the jContentHider plugin. While I still had do some work arounds, I got it working the way I want to.
For others interested:
jContentHider on GitHub
Related
I have various templates like sms.birthday and sms.account-created. They all inherit from a base view layouts.sms. On one of the admin pages, I wanted to show a preview of these views by including them with some dummy data. However, when including the views, the first one that is included overwrites the sections of all other views.
// layouts.sms
#yield('sms.content')
// sms.birthday
#extends('layouts.sms')
#section('sms.content')
Happy birthday
#stop
// sms.account-created
#extends('layouts.sms')
#section('sms.content')
Account created
#stop
// admin page
#include('sms.birthday')
#include('sms.account-created')
Expected results on admin page:
Happy birthday
Account created
Actual results on admin page:
Happy birthday
Happy birthday
Instead of using #stop, using #overwrite solves my issue.
https://github.com/laravel/framework/issues/1058#issuecomment-17194530
I am trying to create a Joomla site that would be showing the article order numbers (not Article ID) inside each article. that way I can handle it like a book.
Each page will show the article order number at the corner - like a page.
That way I will be able to have the site modeled by categories and pages will show with their page number (Article Order number) at the corner.
I want to give the user the ability to watch the pages like they are reading books by categories.
I would be happy to know - how can I add the article order number (for each category) inside the article itself.
I am sure that there is a PHP code that can do that.
Thanks so much for your help and assist.
Arye
You'll need to override the default article layout in your template.
If your template doesn't already have an article layout, you can copy the default layout from components/com_content/views/article/tmpl/default.php inside your template override templates\[YOURTEMPLATE]\html\com_content\article\default.php (replacing [YOURTEMPLATE] by your actual template name.
You can then display ordering where you require it within your template by using
<?php echo $this->item->ordering; ?>
You'll most likely want to either check for a certain condition (the article's category, perhaps) to determine whether you want to display the ordering.
Another option is to create an alternative layout instead of overriding the default one. You can rename default.php in your template to, let's say bookpage.php. You will then be able to pick the new layout as an alternative layout in your articles' options.
you can get article id by using
Request::getVar('id');
for more you can check the link
Joomla plugin : how to get article title and article id
for jquery you can do like this. you can create a function and call on every page load it will sort all your content accordingly. you can assign other attributes also in foreach loop.
<div id="allArticles">
<article id="3">Article 3</article>
<article id="1">Article 1</article>
<article id="2">Article 2</article>
</div>
$("#allArticles article").sort(function (a, b) {
return parseInt(a.id) > parseInt(b.id);
}).each(function(){
var elem = $(this);
elem.remove();
$(elem).appendTo("#allArticles");
});
more you can see the working example here http://jsfiddle.net/THMu3/
I've created an alternative layout for one of my articles which can be applied successfully, but as has been highlighted in various forums: if you view the article using the Single Article menu type the alternative layout doesn't get applied because of an XML override.
I have a Joomla site that is setup for Sales and Support where the article info such as date, hits etc is useful but on the marketing side none of that is needed, hence an alternative layout would work well.
I want to know how to enable my alternative layout using the Single Article menu type - I've already got the layout how I want it (testing it by having it overwrite default.php) but want to set it up as marketing.php instead and only have it applied to what is needed.
You're probably not going to like this answer because you have already written you're alternate view. If you were rewriting it to begin with, why would you not write in a way that the side bar parameters (date, hits, ect) are within a container that is only loaded conditionally. This way you would only have one view to worry about and a lot less headaches.
I am trying to change the layout ( css/html structure) of Virtuemart 2 order verification emails. Problem is that I have to make a fake purchase each and every time I do a change in the 10 different files (located # components/com_virtuemart/views/invoice/order/tmpl) that create this email template.
The closest "preview" I got was this direct access url "http://domain.com/index.php?option=com_virtuemart&view=invoice&layout=invoice&format=html&tmpl=component&virtuemart_order_id=1401"
But again it loads Joomla's head/body elements not the actual email template.
So how can I have a "preview" of how the template looks like with my new changes BEFORE make an actual test purchase? Is this possible?
You shouldn't change the core files otherwise the next update of VirtueMart (of which there are many) will erase your changes.
You should use Joomla!'s template overrides which VM2 supports that way you can update as needed to new versions without loosing your changes. See this article on docs.joomla.org on "How to override the output from the Joomla! core" and this one on template overrides.
3. You need to add the &format=raw at the end of the link to retrieve just the output of the component with out the template/html body wrapped around it. Of course that relies on the component as well.
I was going to suggest using raw, but looking at the current VM2 it doesn't properly support the format=raw option. Looking at the mail layout in the invoice view it not structured to return it the way you expect, it actually generates a HTML version by default with a matching text only version.
The best I could come up given those two options
Return a close equivalent of the HTML email
http://domain.com/index.php?option=com_virtuemart&view=invoice&layout=mail&virtuemart_order_id=1401&tmpl=component
Return the text version, albeit wrapped in the html page... you may have to view the source to see your invoice text.
http://shop.craigphillips.biz/index.php?option=com_virtuemart&view=invoice&layout=mail_raw&virtuemart_order_id=4&tmpl=component
We have a website where people can create personal ads in order to find language-partners.
Does anyone have an idea on how to markup these ads using schema.org?
By now we only have rel=author on each author-name of an ad. But it would be good if we could also markup the following elements of the ads:
the ad itself (the div that wraps the ad)
author-image
authoer location/homelocation
creation date
mothertongue
wanted/learn language
description
Thanks in advance for your help!
Uhm, not exactly an expert here, but I think you should wrap all that in a http://schema.org/Person and use the already existing tags for that, assuming the ad links to a user's homepage you can just add the link as a url for the person.
Assuming a div contains all that you just define it as:
<div itemprop="author" itemscope itemtype="http://schema.org/Person">
.... all the properties ....
</div>
If I'm not mistaken all the described properties are already defined in Person, in fact you can find most of them in the example at the bottom of the page, just take a look at http://schema.org/Person
Really can't give you any more information without an already existing markup sample.