Forums / Developer / How to make "empty" view in module?

How to make "empty" view in module?

Author Message

Jerry Jalava

Tuesday 22 July 2003 10:16:17 am

HI,

I'm building a new personal adds module and I would like to know is it possible to make an "empty" view to viewlist...

I tried to search it from other modules, but no module has it...

Explanation: If I have module named "adds", and I have assigned views "view" and "edit" to it.
When I surf to /adds/view I get the "view" view and
when I surf to /adds/edit I get the "edit" view, but if I surf to /adds I get "view '' not found in module adds".

It would be nice if I could redirect /adds/ to ie. /adds/view automagiccally :)

Regards,
Jerry

Selmah Maxim

Wednesday 23 July 2003 12:32:44 am

try this, not sure will work !

$ViewMode = $Params['ViewMode'];
if (!$ViewMode)
$ViewMode="view";

Jan Borsodi

Wednesday 23 July 2003 1:01:53 am

To this you must turn of views for your module by editing module.php and setting

$Module = array( "name" => "Adds",
"variable_params" => true,
"function" => array(
"script" => "adds.php",
"params" => array( "ViewMode" ) ) );

You must then do a check in adds.php for ViewMode and open up the correct script accordingly. Something like.

$viewMode = $Params['ViewMode'];
if ( $viewMode == 'view' )
include( 'path/to/script/view.php' );
else if ( $viewMode == 'edit' )
include( 'path/to/script/edit.php' );
else
include( 'path/to/script/view.php' );

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Jerry Jalava

Wednesday 23 July 2003 9:33:06 am

Thanks, I'll give it a try...

I encountered to other problem...
When I fetch something from template with fetch function, what kind of data my addsfunctioncollection.php should return? (That is the file that returns the data to template after fetch, right?)

It should return somekind of array right? I tracked the module ezurl's functions and founded it too complex for this... ;)

After fetch has been made in template I'm connecting to function_definition.php and through that to addsfunctioncollection.php's function fetchList()... fetchList function gets variables from function fetchListFromDB(). FetchListFromDB returns back to fetchList an arrayquery in a variable and then fetchList returns this to template with [code] return array( 'result' => &$list ); [/code]...
- Should I parse it somewhere before I send it to template?
- How can I get that data in template? ($List:item.?)
- Is there a way to just check everything that comes to template?

OK, I thinks that was already too much to ask, but I hope someone could lighten me up even a bit... I'm soooo close to finnishing this ez portal project. I only need few modules witch I have to make...

Thanks a lot, :D
Jerry

eZ debug

Timing: Jan 18 2025 19:22:58
Script start
Timing: Jan 18 2025 19:22:58
Module start 'content'
Timing: Jan 18 2025 19:22:58
Module end 'content'
Timing: Jan 18 2025 19:22:58
Script end

Main resources:

Total runtime0.1812 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 587.7188180.8281
Module start 'content' 0.00860.0052 768.546997.8828
Module end 'content' 0.01380.1674 866.4297526.8281
Script end 0.1812  1,393.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00412.2609200.0002
Check MTime0.00181.0020200.0001
Mysql Total
Database connection0.00191.046310.0019
Mysqli_queries0.129571.46271410.0009
Looping result0.00150.80601390.0000
Template Total0.166792.010.1667
Template load0.00080.456910.0008
Template processing0.165991.546910.1659
Override
Cache load0.00060.317910.0006
Sytem overhead
Fetch class attribute can translate value0.00191.044610.0019
XML
Image XML parsing0.00020.131410.0002
General
dbfile0.00422.3302200.0002
String conversion0.00000.003230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs