I would like to make a block whose content is equal to the last article inserted.
also must have a fixed size, and always stay on the home. How do?
see also image:
Fire up Views, make a new block view that displays nodes, under sort criteria, use node post date, then under Pager, select Display a specified number of items and set it to 1.
Go to Structure -> Blocks and set your new block view to display on the home/front page.
Related
I am working on automating a webpage using PyCharm and Selenium(Python), in which i am creating a data and after creating it, i want to edit/update/delete the data. In my case, the xpath of edit element is rel xpath= //tr[{Digits}]//td[4]//a[1] in which the {Digits} i.e. the row id value keeps on changing, it may increase or decrease according to business requirement. Same goes with delete element rel xpath= //tr[{Digits}]//td[5]//a[1].
What i am trying to achieve is, i want to click the edit and delete elements which is only achievable using the xpaths mentioned above(in which the table row ids are dynamically changing).
Apart from these two elements no other elements are clickable or could make any changes in the record/data which i have created. So is it possible to handle dynamic row ids of the table for the list of the records/data created?
Since i am not allowed to share picture but i could share the following details:
Attributes which i got for Edit element are:
<a class="coral-Link coral-Link--subtle" href="/lucent/service_detail_types/292/edit" style=""><i class="coral-Icon coral-Icon--sizeXS coral-Icon--edit"></i></a>
Attributes which i got for Delete element are:
<a class="coral-Link coral-Link--subtle coral-Form-fielderror" data-confirm="Are you sure you want to delete this?" data-method="delete" href="/lucent/service_detail_types/292" rel="nofollow" xpath="1"><i class="coral-Icon coral-Icon--sizeXS coral-Icon--delete"></i></a>
I have a standard Master > Details page in AngularJS setup using RouteProvider.
The Master page has a variation of "infinite scrolling" where Data can be added AND removed at both ends. Say, the user is looking at Contacts list, and has scrolled to 312th entry of the Contact List, only Contacts numbered 200-400 are kept, and the entries 1-200 are removed from Scope. Of course, when the user scrolls DOWN beyond 360, the list is appended with 401-500. And if the scrolls UP above 240, the list is "pre-pended" with 100-199.
Now, the user can click on a particular Contact and go to the Details page. Upon pressing 'Back' (window.history.back) how do I make the Master page re-render with,
Exact list 200-400 as it was when the page was left
Scrolled exactly to the position 312
(IMPORTANT) Listeners still listening correctly for scroll events beyond 360 or above 240?
Is this even possible? And if yes, please help me with how.
I'm not going to write code for this, it's a bit difficult without a deeper understanding of how your infinite scroll works but will offer some ideas
The first thing you would need would be to store the view state in a service and for more robust persistence ( page reloads or return visits) in localStorage synchronized with the service.
The main start point for the view state would be a start index so you know what to filter in your data array ... and either a length value that may or may not be constant in your app or an end index.
As for the scrolling you could use a scroll event handler in a directive to update the service object with offset scrollTop value in order to set on subsequent visit.... angular.element(containerElement)[0].scrollTop = service.scrollTop as a loose example
There is also $anchorScroll service that you could use by setting ID on each item
This won't give you a full solution but hopefully can get you started
Note that you will need to account for time it takes to render ng-repeat by defering to next digest cycle before trying to set scrollTop if you use that
I am trying to make a page on Drupal 7 which should look this way:
I am able to create:
new content type
new view
nodes
But I don't know, how to set up the view. Could you help me please?
The simple solution is create one view page to display heading1 and node1, node2. And then create two blocks block1, block2. In block1 display heading2 and node3, node4 and in block2 display node5.
In the blocks section specify the blocks visibility only to one url which is of the view page you have created.
To limit the number of nodes and creating the offset you can use pager to display specific number of options.
I have an app with multiple columns (about 3 columns as least), each column is a more detailed view of an item in a column on its left. This type of layout is similar to Asana's.
Lets take an example from 1 of the page I currently have:
Column 1 list all current users, clicking on 1 user will open a list of all sales orders of that user on column 2.
Column 2 show list of all orders of 1 selected user on column 1. Clicking on 1 order will show the details of that order
Column 3 show all details of an order selected on column 2. Clicking on a shipment in that order details will show the details of the shipment
Column 4 show all the details of a shipment selected on column 3
So on a so forth. Now there is another twist:
Column 2,3,4 show these details in a form, which mean they can be edited and submitted. Once they are submitted, it makes sense to reload all the column on the left of that edited column to refresh the info. However, for performance purpose I would like to reload them all in a single request and send them back in one json array hen update each column that has newly returned view code (lets assume the backend code is smart enough to handle all this)
I believe someone must have had this issue before, what is your solution to get around this?
Since you are loading different set of data. Its good not load them all at once. You can use ng-include and the the content of the ng-include can be triggered based on the clicks.
ng-inclue="<<scope variable>>"
For ex. In your controller,
Chnage the value of salesurl based on user action
<div class="slide-animate" ng-include="salesurl"></div>
The scope variable can be an URL, which renders the result set based on the parameters posted after user action.
Hope this help.
as the title says I'm trying to create a view that displays rendered files and nodes together. Normally when you create a view you have to select what type of content (nodes, taxonomy, files ...) you want do display.
What i want to achieve is a view that displays all nodes and files. The files are NOT mandatory associated with a node. But they are also tagged with terms.
Any idea how to solve that?
Thanks in advance,
Fab
Why don't you create 2 block views and then display it in a page?
For example:
Create a view block that displays the files --> "display_files-block"
Create a view block that displays the nodes--> "display_nodes-block"
and then print them in a static page u create,
For example: "Display files and nodes", with id 1.
inside page--node--1.tpl.php write:
$block = module_invoke('views', 'block_view', 'display_files-block');
print render($block['content']);
$block = module_invoke('views', 'block_view', 'display_nodes-block');
print render($block['content']);
This doesn't answer the question correctly but can be used as a work around for getting data from two entities to appear in one view.
Through the UI, you could create a view called FilesAndNodes, and only add Global:Custom Text Area under the fields section.
Then create another view called Files, and add this view under the Header section of FilesAndNodes view.
And then do the same for nodes.
The Block created by the FilesAndNodes view can then be added to the page, and the content appears as one view.