How to search through custom component files and reference mysql tables for Joomla's front-end com_search component? - search

I'm using Joomla 1.5 and I'm trying to get the search component in the front-end to reference my custom components, not those just through com_content and com_newsfeeds, etc. A lot of my custom components get data from MySQL so it would help even more if I were able to add the tables for com_search to go through as well (in addition to referencing the actual file for the component itself, where the static HTML surrounding the PHP tags are written). Has anybody tried doing this?

Looks like you need to create search plugin, which will do search through your own component. Check this:
http://docs.joomla.org/Creating_a_search_plugin
Also, would be helpfull to look on default joomla search plugins. They are stored there
\plugins\search\
I hope it will be helpfull.

Related

How do I find every page where a form is used across a Kentico instance?

I'm have a Kentico site where there are dozens of old forms produced and managed by the Forms module (formerly BizForms). Many of them have various things wrong with them which will break my instance if I try to upgrade it. I need to be able to find everywhere a form is used on the instance so I can see if it's still in use and where to drop in its fixed replacement.
I'm currently on Kentico 8.2 and trying to upgrade all the way to Kentico 11, which is where the breakages occur.
You first need to understand where a form can be added from within the Kentico UI. Second, you'd need to take into account none of this will work for any instances where there is a form name hardcoded in any custom code. This will only reference the Kentico UI updates.
Where can forms reside in the UI?
Inside a page template using a webpart
Inside page content using a widget
If you're doing a search within a template, you need to create a SQL query to run code similar to this:
select *
from CMS_PageTemplate
where (PageTemplateWebParts like '%formcodename%' -- replace "formcodename" with your form code name
and PageTemplateWebParts like '% type="BizForm" %')
If you're doing a search within the page's content, you need to create a SQL query to run code similar to this:
select DocumentContent, *
from CMS_Document
where DocumentContent like '%(name)BizForm|(BizFormName)formcodename|%' -- replace "formcodename" with your form code name
Either if these queries should get you close to what you're looking for keeping in mind there is nothing out of the box.

Kentico 10 - Web Part content change via database

i was trying to understand in the Kentico's database model how can i change the web parts content using a database script.
So, basically i have a website based on Kentico with several articles, and internal hyperlinks in its content. But the problem is that the format of those hyperlinks are actually invalid. And i was looking for a way to build a script and do a bulk-update in order to replace some characters and update those hyperlinks to the valid format.
Any idea how can i build the query to get the content of all web parts used in all published pages.
Thank you
It depends on your web parts and how the content is rendered. There are different ways that web parts render their content:
The web part layout is used for markup
The ASCX file for the web part is used for markup
The web part makes use of a repeater that uses a Transformation to render the markup- The markup is generated in code behind
The last one can be tricky to change depending on the web part and whether you have access to all the code behind, but the others you can change either in code in your solution or within the Administration area itself.
Doing this in SQL would probably require a combination of T-SQL XML support and regular expressions to find what you're looking for. you effectively need to look in the CMS_WebPart and CMS_WebPartLayout tables to find what you're looking for.
However, reading your query, I'm not 100% sure you're talking about web parts, (my apologies if you are) as you talk about links in the article content itself. If these are set using the Editable text web part, then you need to look in the CMS_Document table at the DocumentContent field to find the links to replace. But you then need to look at how to correctly format those links going forward so that you do not need to repeat this process later.
Note:
You need to be really careful when doing this in SQL to make sure that you don't create invalid XML. Things go bad when you do that.
This won't flush your cache, so you'll need to clear your cache manually afterwards.
If you're using out-of-the-box web parts, you should really make a copy of them and use the copy if you're going to modify, this way, you're less likely to have pain in future upgrades.
Typically "content" is not set in a webpart. Webparts are configured to retrieve content from page types. There is an exception to this with specific webparts like Editable Text, Static Text, Static HTML, etc.
The configuration of a webpart is stored at the template level in the cms_pagetemplate table. The configuration for ALL webparts on that page template are stored in the PageTemplateWebParts field. So you'd have to parse through the XML and get the proper webpart and then perform an update on that field. You maybe able to do a regex to find that content and replace it as well.
Not ideal to do this via SQL simply because of version history and it can cause a lot of problems later on. I'd suggest finding out which API calls you can make to perform these updates and write a small program for it.

Customize Search Portlet in Liferay DXP 7

I would like your support in order to get some help in customizing the search component in Liferay DXP 7.0 Enterprise.
I have reviewed all the available documentation but although I have found many articles about the issue, the step by step is not so clear for me.
I need to customize the native search component:
Change the input component to give suggestions while the user is typing the search terms
Change the search result page look and feel.
Anyone ever implemented anything like this?
I know this is an old thread, but StackOverflow keeps showing it as the first open question when I am navigation this particular tag...So here are some pointers, as this is a pretty broad topic...
The search is really confusing for adding customization. Mainly you have to provide some of them as contributors, using the asset framework. following the regular steps to build an asset for the asset publisher you will hit the best place to find documentation about the search contributors.
About the search page, best is to create a new page, besides the default one for extra freedom. As long you use the friendly URL /search it will a basic replacement. In this page you can add everything you need, except for translations for the friendly URL - not great. Another option is to keep the default page (which will not be visible in the build area 7.1.x, but you can edit after you search something and fall inside it).

Drupal how to add a search filter to admin content page

I've never used Drupal before (development or managing content). I was asked to extend the admin content page to have a filter and simply don't know enough to get moving quickly.
Can anyone tell me if adding a search by text filter in the admin content area requires code or is there a CMS feature like adding a node for this task.
If code is required, is there something like a hook for this area? Not sure where to start. I will be investigating on my own but pointers to get me oriented to Drupal would help.
By default Drupal provides search mechanism ready to use. But there are also additional module which can improve search experience. You don't need any coding to use that search. You already have search form block ready to use.
Go to Structure -> Blocks and find block called "Search form". Now all you have to do is to put that block in some region and it will appear on front-end. Of course if it's not already styled by your theme it may be needed to put some extra CSS to make it look nice. There are also some template files which you can override and put some your HTML if you need.
There's also template file for search results page (which of course will work out of box also).
You may also need to create new block region if you want to place your form at some specific place, not covered by any existing region defined by your theme (easy thing to do!).
See https://drupal.stackexchange.com/q/30633/101329, the "Admin Views" module lets you configure the search form as you like.

Laravel pagination redirect

I'm using Laravel 4 pagination, and want to remove the page=1 and serve the default string instead; for example:
http://domain.com/search-results/
instead of
http://domain.com/search-results/?page=1
Of course, for page >=2, it's just fine to leave:
http://domain.com/search-results/?page=2
Currently Laravel will always default to showing ?page=1.
Accomplishing what you want (always defaulting to not showing ?page=1) involves a mix of extending/using your own Presenter and/or also by using a custom Pagination view.
Stock pagination views are here, but you can create your own and define it within the view.php config.
In my blog, I do similar. My pagination view is here. You can see it loads in a custom Presenter class.
Note that my blog may not be up to date with latest Laravel code, but that should get you on your way to making the edits you need to do to accomplish that.
You may be able to skip code altogether and use a server configuration to redirect - That link assumes Apache.

Resources