Do you have a custom active admin index page builder? - activeadmin

I would like to build a custom index page for ActiveAdmin.
I don't mean the records shown in the index or the list of columns to display -- I mean a custom view as described here:
https://github.com/activeadmin/activeadmin/blob/master/docs/3-index-pages/custom-index.md
A Google and SO search does not turn up any code samples. I have looked at the Active Admin code itself -- but also wanted to see some examples.
Ideally, I would be able to reuse the filter and scope and table components that the index provides -- I simply want to move things around quite a bit and add a custom component or two.
Anyone have any pointers or examples?

activeadmin has nice wiki page here https://github.com/activeadmin/activeadmin/wiki/Plugins
there u can find at least several implementation of custom index components
for instance
https://github.com/bys-control/activeadmin-index_as_calendar
https://github.com/zorab47/active_admin-sortable_tree
And of course take a look at sources
https://github.com/activeadmin/activeadmin/blob/master/lib/active_admin/views/index_as_grid.rb
https://github.com/activeadmin/activeadmin/blob/master/lib/active_admin/views/index_as_table.rb
https://github.com/activeadmin/activeadmin/blob/master/lib/active_admin/views/index_as_blog.rb
https://github.com/activeadmin/activeadmin/blob/master/lib/active_admin/views/index_as_block.rb
You can try to inherit from one of them and add your own missed parts, depends on your needs

Related

One custom display form for all the lists

Good day to you. I am newbie in SharePoint 2013 so please bear with me. I have created around 15 lists in my website each containing same columns but different data (they differ semantically).
I am aware that we can change the default view, edit and display form for each list by creating new form in SharePoint Designer 2013. This seems like a very bad approach as far as the maintenance is concerned. I know my lists are exactly the same so why do I have to create same 15 display forms for each of the lists?
Is there a way to create one custom Display form (may be in a central location, i don't know i am just thinking :P ) for all the lists? Is there a way to tell a list to use a specific display form? Any help will be highly appreciated. Thanks.
If i understand your question correctly, you have 15 lists with same set of columns. You want to change the display/look of the form. All 15 lists should have same look and feel right!! If yes, then why don't you try with some html, javascript solution. Since you are in sharepoint 2013, javascript support for solutions is very good like rest queries. You can use SPServices also.
If you want to to add data to the list whenever you click on the "New Item" link in the list then hijack this link such that it should navigate to your custom form. Pass your list name as query parameter. Whenever user is saving the form, get the list name from the query parameter and save the data to that list.
There could be another ways also to achieve the solution with html and javascript.
Useful links:
Microsoft, Microsoft, SPServices
Sam I think you can create a custom content type and create custom display form for your content type. Enable the content type in each of your lists so automatically this customized form would be available.
The advantage of this approach is that suppose if you need one more list after some time you can just add this content type and your form would be available into the new list as well.
The approach is explained in the link below.
http://blogs.msdn.com/b/varun_malhotra/archive/2009/06/06/define-custom-new-edit-display-forms-for-content-types.aspx
Check this one also
https://joshmccarty.com/2011/02/sharepoint-custom-list-with-custom-content-types-and-custom-display-forms/
Just wanted to write the solution which I implemented as it might help others as well. (Thanks Hiren and Mihir for your valuable inputs)
I had 15 lists and I was showing the data to the user using content search web part with custom display template. All of the lists were using the same display template so I made a new page just to show the item details. In the display template I pointed the item URL (i hijacked the list name and the current item id) to my new page and displayed the item. Let me know if anyone is interested in the whole solution or further elaboration is required.

Search a specific search of a journal article based on the user type

I have this requirement:
We have a journalarticle and we wish to have sections which have content for internal and external users for the application.
We are able to hide the content from rendering by implementing custom template on web content display and using a simple custom-field for a user which helps us to classify it.
Having said that when we search something as an external user, the search portlet is able to fetch an article where the search text is a part of internal user content, and due to the above mentioned template the content is not visible.
In short, from the user's perspective the resultant article does not match the searched term.
I wish to seek some pointer to check whether there is a mechanism to ensure that when an external user searches something then we only search the dynamic-element of the doc which matches the user type?
We have thousands of such articles and create multiple copy of the same article does not seems viable solution.. so any pointers would be a great help.
Liferay version : 6.2 GA4 CE
Thanks!
AJ
First of all: Not finding a search term in a document can be a sign of good working synonym resolution in the search engine. It's questionable if this behaviour is always wrong or only in this particular case. Remember google bombs?
That being said, I believe that this architecture of half-visible documents is flawed from the beginning. Ideally I'd suggest to change it, for example by splitting the information to two articles, so that you can use the standard permissions to resolve. If you link both, you can determine how/which article or template to use. It's not an ideal solution, but might be a workaround.
Another workaround might be to change Liferay's indexer component and index two different versions of the article, with two different permissions. Of course, you'll have to change the search side as well, so that you'll find each article at most once, even if it's now twice in the search engine.
Again - not ideal, but might be the quickest fix that you can get right now without changing the underlying architecture. However, to change the underlying architecture is my actual recommendation.

Drupal, Solr & Facet Api - Persistent facet links in blocks

I need to produce facet block from two vocabularies in my site. I am using Views and a patched version of Views infinite Scroll to generate the search page, using my search index, and I have tweaked everything I could in the facet display settings to see if I could produce the requested results, to no avail.
I do not need keyword searches. I need to show all taxonomy terms in each facets at all times and to be able to select a single criteria at a time from each vocabulary. So, never more thane one selection at a time from each facet block.
Why are you using Solr to store data and generate your search page, if you do not need keyword search and are trying to go against the native working of solr Facets, I hear you say? For performance reasons, it is the reason why I am using Solr to store & serve the results, I have even gone as far as pushing renedered node to the index with the help of the somwhat obscure search_api_solr_view_modes module.
I could take two separate routes
Create a custom block, load all the taxonomy terms, alter the output of the term link to point to the view and provide the TID for the View. The active filter data could be obtained from the view arguments. I know how to do that but feel it is the wrong way to go about it, if I am working with Solr, I should be using a facet, not a custom block.
Build a custom Facet block that has this exact behaviour. After reading a lot of documentation, I git kind of dicouraged with the possibility of doing this simply without having to develop a Facet plugin, which is kind of out of my league.
Any advice is appreciated.
Here is a screenshot of the interface I have to produce.
http://imageshack.com/a/img834/9836/kr0i.png
Each taxonomy term has to be persistent, i.e., produce a link event if there are no nodes indexed under this term.
Selecting a term in one of the vocabularies will deselect previously selected terms
Clicking on the x next to a term will remove it form the active search criterias.
Have a look at this. https://drupal.org/project/ajax_facets This might get you to where you need to be. Sans you infinite scroll. There is a youtube video that goes with it. http://www.youtube.com/watch?v=pBj3OkXLyWs
I'd appreciate it if it works as I haven't tried it my self.

Modx - Extend site_content - Add new table

Currently, we're running revolution 2.2. On site_content, we have some tags that are ran for crawling twitter. I want to start tracking the number of results for each tag as results come in, to determine which tags don't return that many results, etc.
So I was thinking that I should create a new table (twitter_data), and have a foreign key that will link it to the search tag ID, which is stored in site_content.
What is the best path to accomplish this? Should I create my table then run the reverse schema tool, outlined here?
http://rtfm.modx.com/display/revolution20/Reverse+Engineer+xPDO+Classes+from+Existing+Database+Table#ReverseEngineerxPDOClassesfromExistingDatabaseTable-CreatingaMySQLtable
I also found this, but not sure if this is what I should be looking into:
http://rtfm.modx.com/display/revolution20/Using+Custom+Database+Tables+in+your+3rd+Party+Components
Probably not - if you can avoid modifying the core modx schema do so. an external table may be your best option, but requires a fair bit of work.
though if you can explain wht you mean by 'tags' a little better [html tags? snippets? content tags? not sure what you mean] there may be other options. for example. one of our clients wanted to count page hits [and didn't want to use google to do it] so all we did was to create a template variable bound to each page they wanted to count and then updated that appropriate variable by writing plugin to fire on the onpageload or onpagerender event. [I don't ermember exactly which or what it was called]
Basically, you may be able to do this by writng a plugin rather than trying to extend anything or add snippets/chunks.

Can I use a Kentico macro to get a partial path?

I would like to know if it is possible to use kentico macros (not necessarily coding a custom one) to access part of the rewritten URL's Path.
Example: http://www.mysite.com/Category/Subcategory/
I would like to get the last part (Subcategory) so that I may then filter content dynamically. The reason I want to use the macro is to simply not have to have 20+ different page templates only so I can have different web part properties.
Assuming you are using Portal templates, and you don't want an 'all items in all subcategories' list on the parent:
Create an Article List web part on the parent page — parent to all the sub-categories.
Set the web part Path to /{0}/{1}/{2}/% (if your path was /Home/Parent/Subcategory for example) or something similar for your environment.
Use the default setting of Inherit for the page template for all subcategory pages.
This will not show anything on the parent page, and the sub-categories will show only the documents under themselves. Note: If you want the subcategory items to have their own views when user digs down to /{0}/{1}/{2}/item, you may need to filter by changing template inheritance, or Document Types on the web part, or something like that if you don't want the whole sub-category list to also show on the item-specific pages.
You can create a custom macro or, you can also use the string operations which are allowed within macros. Please see http://devnet.kentico.com/docs/6_0/devguide/available_macro_methods.htm#string_methods (and you can e.g. use the EndsWith or TrimStrart or something similar).
However, I think the best way would be to create a custom macro which will exactly fit. There might be some combination of macros and macro functions - but I think it is faster just to code a custom one which will cover your need 100%.
Also, you can take a look on the K# if there is something that will fit - http://devnet.kentico.com/docs/6_0/devguide/ksharp_syntax.htm

Resources