solved Remove Profile Widget

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
We have created a new Quota to limit profile modules, however some widgets do not seem to be controlled by quota. For example, Latest Images, activities, etc..
--
We understand Quotas, and that is working well. Now trying to learn how to turn off and on widgets on profiles.
--
We understand Site Builder can add / remove widgets from the main index home page, but do not see a Site Builder on user profile page?
--
How to remove profile widgets like Latest Images, Latest Activities, Latest Discussions?
updated by @softdesigns: 05/31/17 10:29:17PM
michael
@michael
7 years ago
7,714 posts
Right, short answer: {jrCore_list}

Docs: "{jrCore_list}"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/89/jrcore-list

--
Longer answer: There are 3 main sections to a jamroom system ( 4 if you consider Forms as a section ), those sections are
ACP - where the system is configured and modules set up
Profiles - your community members upload stuff to, like videos, activity, .....
Top section of the site - which includes the home page and any levels above profiles.

The Top section of the site is the location users visit before getting into any specific profile. There can be as many pages as you like here. This is where Site Builder lives.

Site Builder is a GUI replacement/alternative for template files in the skin.

So you could use Site Builder to create pages, OR you could use the skins .tpl files to create pages, whichever you are more comfortable with.

eg: if you wanted another URL at
yoursite.com/information

You could go to that url as the admin user and Site Builder would ask "Do you want to create a page here?" and you could click that and create a page there via site builder.

The other way to get a page at that URL would be to add a new .tpl file to your skin
/skins/YOUR SKIN/information.tpl

Then add smarty/html code to that template. It would also create the same page there.

All depends on whether you want to build the pages via a web browser or and IDE.

So.....
If you want to display a list of things in a .tpl file you would use the listing function:
{jrCore_list module="?????"}

and that would display a list of whichever module you were after. In Site Builder there is a GUI to do it but its the same function.

Each of the "Latest Images" "Latest Activites" "Latest Discussions" will created using that {jrCore_list} or the Site Builder equivalent.

What you need to do is tweak that list to only include the quota that you are after. Its very versatile.

Take a look at the docs and ask if you have any questions.
--

If you take a look through the .tpl files in any skin you will find a TON of jrCore_list calls, eg:
 {jrCore_list module="jrFlickr" profile_id=$_profile_id order_by="flickr_display_order numerical_asc" pagebreak="9" page=$_post.p pager=true}
= "Get me all the flicker items from profile id X order them with the oldest at the top and only show 9 before showing the pagination buttons"
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
Great Explanation, another very clear example where JR platform is quite versatile :)
--
For our purposes coding the template .tpl files directly seems our best option.
--
Will take quite some time to study, so we can close out this thread...
--
Solved
michael
@michael
7 years ago
7,714 posts
Yeah, you'll find {jrCore_list} is the go-to tool for getting anything out of a datastore.

Jamroom has 2 types of storage tables inside the mysql database, a regular one, where you write normal SQL queries to access, and a special one called a 'datastore'

A datastore is a key => value storage system that each module can have up to 1 of.

The advantage of using a datastore in module development is that it allows for easy addition of database column types.

In a conventional mysql table, if the colums are
id | name | title

In order to add another column 'age' you need to alter the database structure
id | name | title | age

But with a datastore it just has
_item_id | key | value

So this allows other modules to add things to each others datastores without the need for alteration of the database.

An example of this is the Tags module, it adds things to any other modules datastore, without that module needing to know or care whether the Tags module exists or not.

An blog entry might look like this
_item_id | key | value
1 | blog_title | a blog for saturday
1 | blog_text | bla bla bla bla bla bla bla .......
1| blog_date | (time the blog was created)

Then the tags module can come along and add tags to that blog
1| blog_tags | ,saturday,racing,sunny,events,

This allows for complete separation of modules, but also integration of modules.

Then you can use the {jrCore_list} template function along with a search="" clause to retrieve whatever you want from a datastore
{jrCore_list module="jrBlog" search="blog_tags like %sunny%"}

This way you can get the only the blogs back that have the 'sunny' tag on them.

--edit--
The Tags module was an example of a module adding to another modules datastore, but you dont have to do it via a module.

If you want to add extra tags to a modules datastore just for your system, you can use the Form Designer.

Docs: "Using the Form Designer"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-admin-handbook/1275/using-the-form-designer

To add any extra fields you require.
updated by @michael: 02/26/17 01:59:41PM

Tags