Closed (works as designed)
Project:
Component
Version:
6.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2007 at 23:01 UTC
Updated:
7 Jul 2013 at 01:59 UTC
how do I use it? I can't find any manual for it.
Comments
Comment #1
stinky commentedDitto. how do I use it?
Comment #2
yngens commentedsame question here.
readme file is very laconic. no settings or detailed instruction for the module.
Comment #3
Crell commentedIt's a utility module, mostly for themers. See: http://www.garfieldtech.com/blog/component-module
Comment #4
pcdonohue commentedThe component module provides hooks that you can call via urls to access your sites data via an AJAX call.
For example, for views, you can load http://yoursite.com/component/view/yourview and it would return your view...
I still haven't quite figured it all out but here's an example from the site I'm developing.
I have a view named bopedia that I want to display at the bottom of a page. The usability I want is to be able to page through that view without having to reload the whole page (clicking on the pager would normally reload the entire page).
I set up a div with an id and a url variable that I can use to pass which view I want to page through, and then use views_build_view to embed the view in the page for the first time.
Then I have some jquery code set up to catch clicks on the pager items, with a few helper functions too.
This works, when I click on the pager it fades out the current items and then loads the new ones. Though with one problem mentioned at http://drupal.org/node/197879
I'm also certain this could be a lot cleaner too.
Comment #5
FatalRemedy commentedI didn't find that the site said much about it.
If you simply look inside the component.module you can see the various functions it provides, I've taken most of them out, just to make it a bit easier.
All of these are functions that can be called like <? echo component_get_view('articles_top_rated'); ?>
component_get_block($module, $delta, $title_text = NULL)
- Returns the themed contents of a block specified by module and delta
@param string $module - The module that provides the block we want
@param mixed $delta - The delta of the block we want
@param string $title_text 0 The text to use in place of the default title, if any
component_get_view($view_name)
- Output function for the 'views' content type. Outputs a views based on the module and delta supplied in the configuration.
@param $view_name - The name of the view to display
component_get_view_filter_form($view_name)
- Returns the rendered filter form for a specified view
component_get_panel($did)
- Returns rendered panel
component_get_node($nid)
- Returns rendered node
Comment #6
kulfi commentedLike the others, looking for documentation ...
Comment #7
pfaocleSee #3 - the module provides several functions for coders/themers to call to grab nodes, blocks, panels views etc. There are no need for settings.
#5 is an outline of the functions available, perhaps these should be added to the project page and/or README.txt
Comment #8
jitj commentedI found a neat use for this module in order to put content from a view provided block into a block on another site. Just install and activate this module on the site providing the information and then put the following php snippet into your block on the site where you want the information to display:
This is much more elegant than trying to use iFrame. I'm using it for a multi-site setup where I want an alert box showing on all of the sites.
Comment #9
bloke_zero commentedyou can get the basic node e.g.
node/955/component
without header and footer - great for little pop-ups with thickbox
Comment #10
Oleksa-1 commentedIf needed to send argument to view it is poss to do by this way
http://yoursite.com/component/view/[yourview]/[display]/[argument]
@jitj thx for sharing with your idea about file_get_contents() . It is really great.
Comment #11
JohnnyX commentedIs it possible to load a themed node / block with title? If I load a node with .../component/node/1 I get only the node content without title. I will use component to load themed nodes and blocks with ajax if javascript works. If javascript is deactivated it should reload the page the normal way.
Comment #12
Crell commented