Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are using Views then try the following.</p> <ol> <li>Add <strong><em>Contextual filters</em></strong> in <strong><em>Advanced</em></strong> fieldset and select <strong><em>Date: Date (node)</em></strong> filter.</li> <li>In it's settings in <strong><em>When the filter value is NOT in the URL</em></strong> fieldset tick <strong><em>Provide default value</em></strong> and leave <strong><em>Current date</em></strong></li> <li><em><strong>Add multiple value identifier</em></strong> set to <strong><em>No</em></strong></li> <li><em><strong>Dates to compare</em></strong> set to <strong><em>Only this field</em></strong></li> <li>Between <strong><em>Date field(s)</em></strong> checkboxes select <strong><em>Content: Post date</em></strong></li> <li><em><strong>Method</em></strong> set to <strong><em>OR</em></strong></li> </ol> <p>After that, by accessing your <strong><em>/test</em></strong> page you would have the last added content and by accessing <strong><em>/test/%date%</em></strong> you would have content for that date. For example <strong><em>/test/2011-12-23</em></strong></p> <p><em><strong>%date%</em></strong> should be as ISO date/period format (i.e. YYYY, YYYY-MM, YYYY-MM-DD, YYYY-W99, YYYY-MM-DD--P3M, P90D, etc).</p> <p><strong>EDITED: 19-01-2012</strong></p> <p>Follow this path <code>http://yoursite/admin/structure/views/import</code> in your site and put the following data to code textfield:</p> <pre><code>$view = new view; $view-&gt;name = 'test'; $view-&gt;description = ''; $view-&gt;tag = 'default'; $view-&gt;base_table = 'node'; $view-&gt;human_name = 'test'; $view-&gt;core = 7; $view-&gt;api_version = '3.0'; $view-&gt;disabled = FALSE; /* Edit this to true to make a default view disabled initially */ /* Display: Master */ $handler = $view-&gt;new_display('default', 'Master', 'default'); $handler-&gt;display-&gt;display_options['title'] = 'test'; $handler-&gt;display-&gt;display_options['access']['type'] = 'perm'; $handler-&gt;display-&gt;display_options['cache']['type'] = 'none'; $handler-&gt;display-&gt;display_options['query']['type'] = 'views_query'; $handler-&gt;display-&gt;display_options['query']['options']['query_comment'] = FALSE; $handler-&gt;display-&gt;display_options['exposed_form']['type'] = 'basic'; $handler-&gt;display-&gt;display_options['pager']['type'] = 'some'; $handler-&gt;display-&gt;display_options['pager']['options']['items_per_page'] = '10'; $handler-&gt;display-&gt;display_options['style_plugin'] = 'list'; $handler-&gt;display-&gt;display_options['row_plugin'] = 'fields'; $handler-&gt;display-&gt;display_options['row_options']['hide_empty'] = 1; $handler-&gt;display-&gt;display_options['row_options']['default_field_elements'] = 0; /* No results behavior: Global: Text area */ $handler-&gt;display-&gt;display_options['empty']['area']['id'] = 'area'; $handler-&gt;display-&gt;display_options['empty']['area']['table'] = 'views'; $handler-&gt;display-&gt;display_options['empty']['area']['field'] = 'area'; $handler-&gt;display-&gt;display_options['empty']['area']['label'] = 'No results'; $handler-&gt;display-&gt;display_options['empty']['area']['empty'] = FALSE; $handler-&gt;display-&gt;display_options['empty']['area']['content'] = 'No articles found.'; $handler-&gt;display-&gt;display_options['empty']['area']['format'] = 'full_html'; $handler-&gt;display-&gt;display_options['empty']['area']['tokenize'] = 0; /* Field: Content: Title */ $handler-&gt;display-&gt;display_options['fields']['title']['id'] = 'title'; $handler-&gt;display-&gt;display_options['fields']['title']['table'] = 'node'; $handler-&gt;display-&gt;display_options['fields']['title']['field'] = 'title'; $handler-&gt;display-&gt;display_options['fields']['title']['label'] = ''; $handler-&gt;display-&gt;display_options['fields']['title']['alter']['alter_text'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['alter']['make_link'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['alter']['absolute'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['alter']['word_boundary'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['alter']['ellipsis'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['alter']['strip_tags'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['alter']['trim'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['alter']['html'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['hide_empty'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['empty_zero'] = 0; $handler-&gt;display-&gt;display_options['fields']['title']['link_to_node'] = 1; /* Sort criterion: Content: Post date */ $handler-&gt;display-&gt;display_options['sorts']['created']['id'] = 'created'; $handler-&gt;display-&gt;display_options['sorts']['created']['table'] = 'node'; $handler-&gt;display-&gt;display_options['sorts']['created']['field'] = 'created'; $handler-&gt;display-&gt;display_options['sorts']['created']['order'] = 'DESC'; /* Contextual filter: Date: Date (node) */ $handler-&gt;display-&gt;display_options['arguments']['date_argument']['id'] = 'date_argument'; $handler-&gt;display-&gt;display_options['arguments']['date_argument']['table'] = 'node'; $handler-&gt;display-&gt;display_options['arguments']['date_argument']['field'] = 'date_argument'; $handler-&gt;display-&gt;display_options['arguments']['date_argument']['default_action'] = 'default'; $handler-&gt;display-&gt;display_options['arguments']['date_argument']['default_argument_skip_url'] = 0; $handler-&gt;display-&gt;display_options['arguments']['date_argument']['summary']['format'] = 'default_summary'; $handler-&gt;display-&gt;display_options['arguments']['date_argument']['use_fromto'] = 'no'; $handler-&gt;display-&gt;display_options['arguments']['date_argument']['date_fields'] = array( 'node.created' =&gt; 'node.created', ); /* Filter criterion: Content: Published */ $handler-&gt;display-&gt;display_options['filters']['status']['id'] = 'status'; $handler-&gt;display-&gt;display_options['filters']['status']['table'] = 'node'; $handler-&gt;display-&gt;display_options['filters']['status']['field'] = 'status'; $handler-&gt;display-&gt;display_options['filters']['status']['value'] = 1; $handler-&gt;display-&gt;display_options['filters']['status']['group'] = 0; $handler-&gt;display-&gt;display_options['filters']['status']['expose']['operator'] = FALSE; /* Filter criterion: Content: Type */ $handler-&gt;display-&gt;display_options['filters']['type']['id'] = 'type'; $handler-&gt;display-&gt;display_options['filters']['type']['table'] = 'node'; $handler-&gt;display-&gt;display_options['filters']['type']['field'] = 'type'; $handler-&gt;display-&gt;display_options['filters']['type']['value'] = array( 'page' =&gt; 'page', ); /* Display: Page */ $handler = $view-&gt;new_display('page', 'Page', 'page'); $handler-&gt;display-&gt;display_options['path'] = 'test'; </code></pre> <p>Now by following to <code>/test</code> page you'll have date as today's date. You can also use your date type as <code>20120119</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload