Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Usman Alam 10 posts 29 karma points
    Jun 18, 2012 @ 16:54
    Usman Alam
    0

    urgent help to implement search in Umbraco v5

    Hi all,

    I am new in this forum and it is my first post as well :). I newly start working in umbraco v5 before that i dont have any knowlegde in perious versions. Last few days i have been developing a site in umbraco and i successed to implement all static pages.

    Now i am struck with search functionality. How can i search site contents?. I searched alot and configured umbraco with visual studio 2010 to write some code for search. I am trying to write a Surface controller to implement the search but i dont have any clue what i need to call in that controller :(. I found following code for search but i getting error that Content is not in namespace. This is panic satution for me and no idea what to do :(

    Umbraco.Hive.Content.Where(x => x.ContentType.Alias == "News" && x.Field("bodyText").Contains("YOURKEYWORD")).ToList();

    Please, I really request to if someone can help me regarding that issue or give some idea how can i do. I really appreciate it

    Thanks

  • Kasper Dyrvig 246 posts 379 karma points
    Jun 18, 2012 @ 21:22
    Kasper Dyrvig
    0

    Hi Usman,

    I don't have a solution for your question. But I thought I needed to tell you that there is no future with v5. Last week it was announced that Umbraco 5 is dead (see the keynote: http://codegarden12.com/sessions/day-one/keynote/keynote.aspx).

    Hope you find a solution anyway.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 18, 2012 @ 21:55
    Jan Skovgaard
    0

    Hi Usman and welcome to our :)

    As Kasper says above Umbraco 5 is dead.

    The site you're currently working on is that for a client or is it a hobby project?

    /Jan

  • Usman Alam 10 posts 29 karma points
    Jun 18, 2012 @ 22:24
    Usman Alam
    0

    @Jan Skovgaard & Kasper Dyrvig thanks for your reply. Thats very sad to know that. I am working for client and site has been uploaded last week. Only search funtionality for pending i spent about more than 3 days to find a solution and lastly i decided to ask from the fourm. Anyways, you guys have very experience can you please suggest me what is best option in that satution i will discuss with my boss tomorrow. I will real appreciate your valuable comments.

    Thanks

  • Kasper Dyrvig 246 posts 379 karma points
    Jun 20, 2012 @ 08:30
    Kasper Dyrvig
    0

    Well, I haven't worked that much with v5. Hopefully some else in the community will give an advise.

  • Usman Alam 10 posts 29 karma points
    Jun 20, 2012 @ 10:43
    Usman Alam
    0

    @Kasper Dyrvig thanks for your reply. I am going to start work in umbraco 4.7.2 instead to v5. Is this good choice or I should use previous versions before umbraco 4.7.2.

    Thanks

  • Kasper Dyrvig 246 posts 379 karma points
    Jun 20, 2012 @ 11:33
    Kasper Dyrvig
    0

    No that's great. I'm just about completing a website (www.best-travel.se) build in that version with no problems what so ever.

  • Usman Alam 10 posts 29 karma points
    Jun 21, 2012 @ 16:37
    Usman Alam
    0

    Ok, great. I have few questions regarding umbraco 4.7.2. I just started to convert v5 site to 4.7.2.

    How i can enable Razor in 4.7.2 i trying to use it but getting some issues for example


               @using umbraco.MacroEngines       

              @{

                var image = @Model.Media("topImage");
              }         

     <img src='@image.UmbracoFile' alt='@image.Name' />
            

    and geting Error loading MacroEngine script (file: ).

    Lastly i failed to find a way to get image (uploader property) in a page. For slider i used xslt file and its working fine but i am not sure how can i get image in a page without xslt.

    Please help me i very new in umbraco staff.

    Thanks

  • Kasper Dyrvig 246 posts 379 karma points
    Jun 22, 2012 @ 09:41
    Kasper Dyrvig
    0

    I am not 100 % sure what you're asking, but I understand from the code you try to display an image selected in the current page?

    You are almost there.

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @if (Model.HasProperty("topImage"&Model.topImage != "")
    {
     var image Model.Media("topImage");
     <img src='@image.UmbracoFile' alt='@image.Name' />
    }

    The code above checks if the current page has a "topImage" selected and then show it.

  • Usman Alam 10 posts 29 karma points
    Jun 24, 2012 @ 14:31
    Usman Alam
    0

    Hi Kasper, thanks for your reply. Actually in my site each page has an top image and I created a property upload for that purpose. Now when I am trying to show image using that following code

    @inheritsumbraco.MacroEngines.DynamicNodeContext
    @if(Model.HasProperty("topImage")&&Model.topImage !="")
    {
     varimage =Model.Media("topImage");
     <img src='@image.UmbracoFile'alt='@image.Name'/>
    }

    and I wrote it in TopImage.cshtml  file. When i insert a macro into my web page it gave me following error.

    Error loading MacroEngine script (file: TopImage.cshtml)

    I am wondering why i am getting this error even my file into macroScripts folder and have extension .cshtml.

    Are am I missing some library files for Razor? Can you please help me.

    Thanks

     

  • Usman Alam 10 posts 29 karma points
    Jun 25, 2012 @ 16:32
    Usman Alam
    0

    Hi, this code is working for me. I don't know what was wrong in above mentioned code. I modify it and its working.

    Thank you so much you helped me alot I really appreciated!

    @@inherits umbraco.MacroEngines.DynamicNodeContext

    @{
        if (Model.HasProperty("topImage"))
        {
             <img src="@Model.topImage" alt="" />
        }
        else
        {
            <p>
                This page doesn't contain a MediaPicker property with the alias of 'topImage'
                or No image is selected on this page
            </p>
        }
    }


           

  • Roman Petrenko 20 posts 39 karma points
    Jul 02, 2012 @ 11:18
    Roman Petrenko
    0

    Hi everyone 

    I have very strange issue with umbraco 4.7. When I try to open razor file

    @using System.Web;
    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using System.Xml
    @using System.Xml.XPath
    @using umbraco.MacroEngines;
    @using umbraco.NodeFactory;
    @using System.Linq;
    @using uComponents.Core;
    
    I am really confused why is it and what should I do with it?
  • Usman Alam 10 posts 29 karma points
    Jul 02, 2012 @ 22:30
    Usman Alam
    0

    Hi Roman,

    What issue are you facing can you please paste your error here

     

Please Sign in or register to post replies

Write your reply to:

Draft